[PATCH 2/6] net: cpsw: Add missing return value

Paolo Pisati paolo.pisati at canonical.com
Thu May 7 12:56:34 UTC 2015


From: Markus Pargmann <mpa at pengutronix.de>

BugLink: http://bugs.launchpad.net/bugs/1452628

ret is set 0 at this point, so jumping to that error label would result
in a return value of 0. Set ret to -ENOMEM to return a proper error
value.

Signed-off-by: Markus Pargmann <mpa at pengutronix.de>
Reviewed-by: Wolfram Sang <wsa at the-dreams.de>
Signed-off-by: David S. Miller <davem at davemloft.net>

(cherry-picked from 4d507dffe766b8e29f29d17ae8e0611b5638286e upstream)

Signed-off-by: Paolo Pisati <paolo.pisati at canonical.com>
---
 drivers/net/ethernet/ti/cpsw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 7bf6c4e..024c2b9 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1956,6 +1956,7 @@ static int cpsw_probe(struct platform_device *pdev)
 	priv->irq_enabled = true;
 	if (!priv->cpts) {
 		pr_err("error allocating cpts\n");
+		ret = -ENOMEM;
 		goto clean_ndev_ret;
 	}
 
-- 
2.1.0





More information about the kernel-team mailing list