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  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]
Date:   Sat, 9 Nov 2019 10:06:03 +0100
From:   Markus Elfring <Markus.Elfring@....de>
To:     netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
        Madalin Bucur <madalin.bucur@....com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 3/3] fsl/fman: Return directly after a failed devm_kzalloc()
 in mac_probe()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 9 Nov 2019 09:26:12 +0100

Return directly after a call of the function “devm_kzalloc” failed
at the beginning.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/net/ethernet/freescale/fman/mac.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
index 7fbd7cc24ede..75614e2ebda3 100644
--- a/drivers/net/ethernet/freescale/fman/mac.c
+++ b/drivers/net/ethernet/freescale/fman/mac.c
@@ -614,15 +614,12 @@ static int mac_probe(struct platform_device *_of_dev)
 	mac_node = dev->of_node;

 	mac_dev = devm_kzalloc(dev, sizeof(*mac_dev), GFP_KERNEL);
-	if (!mac_dev) {
-		err = -ENOMEM;
-		goto _return;
-	}
+	if (!mac_dev)
+		return -ENOMEM;
+
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
-	if (!priv) {
-		err = -ENOMEM;
-		goto _return;
-	}
+	if (!priv)
+		return -ENOMEM;

 	/* Save private information */
 	mac_dev->priv = priv;
--
2.24.0

Powered by blists - more mailing lists