Thread (2 messages) flat view 2 messages, 2 authors, 6d ago
COOLING6d

[PATCH] staging: fbtft: replace number with sizeof()

From: Manuel Ebner <hidden>
Date: 2026-09-14 09:09:44
Also in: dri-devel, linux-staging, lkml
Subsystem: fbtft framebuffer drivers, staging subsystem, the rest · Maintainers: Andy Shevchenko, Greg Kroah-Hartman, Linus Torvalds

Replace integer number with sizeof with the goal of prevent future truncation bugs.

Signed-off-by: Manuel Ebner <redacted>
---
 drivers/staging/fbtft/fb_ili9320.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/fbtft/fb_ili9320.c b/drivers/staging/fbtft/fb_ili9320.c
index 0f98267a7..655778392 100644
--- a/drivers/staging/fbtft/fb_ili9320.c
+++ b/drivers/staging/fbtft/fb_ili9320.c
@@ -21,7 +21,7 @@
 
 static unsigned int read_devicecode(struct fbtft_par *par)
 {
-	u8 rxbuf[8] = {0, };
+	u8 rxbuf[sizeof(u64)] = {0, };
 
 	write_reg(par, 0x0000);
 	par->fbtftops.read(par, rxbuf, 4);
-- 
2.55.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help