[PATCH 02/10] net: bcmgenet: free netdev on of_match_node() error

Arvind Yadav arvind.yadav.cs at gmail.com
Sat Dec 2 11:26:14 PST 2017


The change is to call free_netdev(), If of_match_node() will fail.

Signed-off-by: Arvind Yadav <arvind.yadav.cs at gmail.com>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index e2f1268..e0a8f79 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3363,8 +3363,10 @@ static int bcmgenet_probe(struct platform_device *pdev)
 
 	if (dn) {
 		of_id = of_match_node(bcmgenet_match, dn);
-		if (!of_id)
-			return -EINVAL;
+		if (!of_id) {
+			err = -EINVAL;
+			goto err;
+		}
 	}
 
 	priv = netdev_priv(dev);
-- 
2.7.4




More information about the linux-arm-kernel mailing list