Re: [PATCH] iio: proximity: hx9023s: validate firmware size
From: David Lechner
Date: Fri Jul 10 2026 - 11:23:22 EST
On 7/10/26 9:54 AM, Joshua Crofts wrote:
> On Fri, 10 Jul 2026 20:07:12 +0545
> Laxman Acharya Padhya <acharyalaxman8848@xxxxxxxxx> wrote:
>> @@ -1058,6 +1065,7 @@ static void hx9023s_cfg_update(const struct firmware *fw, void *context)
>> }
>>
>> ret = hx9023s_send_cfg(fw, data);
>> + release_firmware(fw);
>
> Why not move this after the if? Keep the call/retval check coupled.
Because the if branch contains a goto and would therefore skip calling
release_firmware() in case of error.
>
>> if (ret) {
>> dev_warn(dev, "Firmware update failed: %d\n", ret);
>> goto no_fw;
>>
>
> Otherwise this looks good. Feel free to add my tag with the v2:
>
> Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
>