lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1512242782-7134-3-git-send-email-arvind.yadav.cs@gmail.com>
Date:   Sun,  3 Dec 2017 00:56:14 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     wg@...ndegger.com, mkl@...gutronix.de, michal.simek@...inx.com,
        opendmb@...il.com, f.fainelli@...il.com, davem@...emloft.net,
        Vladislav.Zakharov@...opsys.com
Cc:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        netdev@...r.kernel.org
Subject: [PATCH 02/10] net: bcmgenet: free netdev on of_match_node() error

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

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ