Thread (8 messages) 8 messages, 3 authors, 2011-08-24
STALE5430d

[patch -next v2] bcma: signedness bug in bcma_get_next_core()

From: Dan Carpenter <hidden>
Date: 2011-08-23 19:15:35
Also in: kernel-janitors
Subsystem: broadcom specific amba driver (bcma), the rest · Maintainers: Rafał Miłecki, Linus Torvalds

The u32 would never be less than zero so the error handling would
break.  I changed it to s32 to match how bcma_erom_get_mst_port() is
declared.

Signed-off-by: Dan Carpenter <redacted>
---
v2:  the first version used "int" instead of "s32".
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index 0ea390f..cad9948 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -281,7 +281,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
 
 	/* get & parse master ports */
 	for (i = 0; i < ports[0]; i++) {
-		u32 mst_port_d = bcma_erom_get_mst_port(bus, eromptr);
+		s32 mst_port_d = bcma_erom_get_mst_port(bus, eromptr);
 		if (mst_port_d < 0)
 			return -EILSEQ;
 	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help