Thread (8 messages) flat view 8 messages, 2 authors, 2021-10-17

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

On 10/17/21 7:26 AM, Dmitry Torokhov wrote:
On Tue, Aug 31, 2021 at 10:25:06PM +0200, Marek Vasut wrote:
quoted
+
+	/* 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help