Skip to contentSkip to conversation

staging: fbtft: fix unchecked write return value in fb_agm1264k-fl

PATCH In review Artem Lytkin 2 participants 2 messages Feb 7 – Feb 8

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: fbtft: fix unchecked write return value in fb_agm1264k-fl

The second call to par->fbtftops.write() does not capture the return value, so the subsequent error check tests a stale value from the first write call. Add the missing assignment so the error check applies to the correct write operation.

---
 drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fb_agm1264k-fl.c +1 -1
index 207d57854..b4883c365 100644
@@ -375,7 +375,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 
 			/* write bitmap */
 			gpiod_set_value(par->RS, 1); /* RS->1 (data mode) */
-			par->fbtftops.write(par, buf, len);
+			ret = par->fbtftops.write(par, buf, len);
 			if (ret < 0)
 				dev_err(par->info->device,
 					"write failed and returned: %d\n",
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Artem Lytkin

The second call to par->fbtftops.write() does not capture the return value, so the subsequent error check tests a stale value from the first write call. Add the missing assignment so the error check applies to the correct write operation.

Hmm... Sounds about right, but it was like that from the day 1.

Signature · 2 lines
With Best Regards,
Andy Shevchenko