[PATCH] drivers: net: xgene: Pre-initialize ret in xgene_enet_get_resources()
From: Geert Uytterhoeven
Date: Thu Jun 25 2015 - 09:13:51 EST
If CONFIG_ACPI=n:
drivers/net/ethernet/apm/xgene/xgene_enet_main.c: In function âxgene_enet_get_resourcesâ:
drivers/net/ethernet/apm/xgene/xgene_enet_main.c:951: warning: âretâ may be used uninitialized in this function
If the driver is bound to a legacy platform device, ret will contain
arbitrary data. If it is non-zero, it will be returned to the caller as
an error code.
Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
---
drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index 95153b234c7158c6..299eb4315fe647ba 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -948,7 +948,7 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
struct resource *res;
void __iomem *base_addr;
u32 offset;
- int ret;
+ int ret = 0;
pdev = pdata->pdev;
dev = &pdev->dev;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/