lkml.org 
[lkml]   [2022]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 1/9] brcmfmac: pcie: Release firmwares in the brcmf_pcie_setup error path
From
On 1/19/2022 6:49 PM, Andy Shevchenko wrote:
> On Mon, Jan 17, 2022 at 4:30 PM Hector Martin <marcan@marcan.st> wrote:
>>
>> This avoids leaking memory if brcmf_chip_get_raminfo fails. Note that
>> the CLM blob is released in the device remove path.
>
> ...
>
>> if (ret) {
>
>> brcmf_err(bus, "Failed to get RAM info\n");
>> + release_firmware(fw);
>> + brcmf_fw_nvram_free(nvram);
>
> Can we first undo the things and only after print a message?

What would be your motivation? When reading logs I am used to seeing an
error message followed by cleanup related messages. Following your
suggestion you could see cleanup related messages, the error print as
above, followed by more cleanup related messages. The cleanup routine
would preferably be silent, but I tend to flip on extra debug message
levels.

Regards,
Arend

>> goto fail;
>> }
>
>
[unhandled content-type:application/pkcs7-signature]
\
 
 \ /
  Last update: 2022-01-20 09:23    [W:0.080 / U:1.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site