[PATCH v5 09/10] tools: spkgimage: add Renesas SPKG format

Marek Vasut marek.vasut at mailbox.org
Tue May 9 16:52:45 CEST 2023


On 5/9/23 15:07, Ralph Siemsen wrote:
> On Tue, May 09, 2023 at 04:25:06AM +0200, Marek Vasut wrote:
>>
>> The usual fail path handling like:
>>
>> "
>> if (there is an error)
>>  goto exit;
>> ...
>>
>> exit:
>> free(data);
>> return ret;
>> "
>>
>> does not work here ?
> 
> Yes, this would handle de-allocation in the failing case.
> 
> However in the normal case (no error), there is no corresponding call to 
> free(). And there is no good place to put such a call, given the API of 
> the callbacks. It would be possible call free() from print_header, 
> however this is brittle since it relies on mkimage core calling 
> print_header as the last step (and only once).

Do we have some sort of global (?) state structure which exists during 
the whole work cycle of the tool ? If so, add a link list into there.


More information about the U-Boot mailing list