From 4e0d8cc1006b889909a87f824943bad9a56358e8 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 23 Aug 2011 22:15:35 +0300 Subject: [PATCH] bcma: signedness bug in bcma_get_next_core() 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 Signed-off-by: John W. Linville --- drivers/bcma/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c index 0ea390f9aa9..cad99485768 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; } -- 2.20.1