Skip to contentSkip to conversation

fpga: fpga-mgr: Fix undefined behavior

PATCH In review Moritz Fischer 2 participants 2 messages Apr 21, 2022 FPGA manager framework

lore
Share & tools
lore

Moritz Fischer

author maintainer
#0 lore raw

PATCH 1/1 fpga: fpga-mgr: Fix undefined behavior

Incrementing void pointers is undefined behavior.

Fixes baa6d3966351 ("fpga: Add scatterlist based programming")
---
 drivers/fpga/fpga-mgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/fpga-mgr.c +1 -1
index 6bd018f20793..3d9b8722f5ce 100644
@@ -299,7 +299,7 @@ static int fpga_mgr_buf_load(struct fpga_manager *mgr,
 {
 	struct page **pages;
 	struct sg_table sgt;
-	const void *p;
+	const char *p;
 	int nr_pages;
 	int index;
 	int rc;
Signature · 1 line
2.36.0
#1 lore raw
Quoted 1 line · Moritz Fischer

Incrementing void pointers is undefined behavior.

AFIACR in the kernel dialect of C this is defined behavior..

Jason