# Re: \[PATCH v3 3/3\] Input: ili210x - add ili251x firmware update support

- From: Marek Vasut \<marex@denx.de\>
- Date: 2021-10-17 14:27:51 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2021/10/8933495
- Thread: https://ratatoskr.run/linux-input/2021/08/8933316/t.md

```text
On 10/17/21 7:26 AM, Dmitry Torokhov wrote:
> On Tue, Aug 31, 2021 at 10:25:06PM +0200, Marek Vasut wrote:
>> +
>> +	/* DF end address is the last address in the firmware blob */
>> +	*df_end = fw_addr + fw_len;
>> +	*buf = fw_buf;
>> +	release_firmware(fw);
>> +	return 0;
>> +err_big:
>> +	kfree(fw_buf);
>> +err_alloc:
>> +	release_firmware(fw);
>> +	return error;
>
> I do not quite like that we have to release firmware in both success
> and error paths, so I moved the call to request_ihex_firmware() to the
> caller of this function and release it before checking the result of
> loading the firmware to buffer, and applied.

Hmmm, looking at the result, maybe it would be better to do the entire request_ihex_firmware() / release_firmware) in ili251x_firmware_to_buffer(). I'll try and see how that looks and maybe send you a subsequent patch if it looks better.

Otherwise, thanks for picking those up.
```
