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: <20241001184607.193461-3-rosenp@gmail.com>
Date: Tue,  1 Oct 2024 11:45:59 -0700
From: Rosen Penev <rosenp@...il.com>
To: netdev@...r.kernel.org
Cc: andrew@...n.ch,
	davem@...emloft.net,
	edumazet@...gle.com,
	kuba@...nel.org,
	pabeni@...hat.com,
	linux-kernel@...r.kernel.org,
	olek2@...pl,
	shannon.nelson@....com
Subject: [PATCHv2 net-next 02/10] net: lantiq_etop: use devm_alloc_etherdev_mqs

It seems there's a missing free_netdev in the remove function. Just
avoid manual frees and use devm.

Signed-off-by: Rosen Penev <rosenp@...il.com>
Reviewed-by: Shannon Nelson <shannon.nelson@....com>
---
 drivers/net/ethernet/lantiq_etop.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 94b37c12f3f7..de4f75ce8d9d 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -601,7 +601,6 @@ ltq_etop_init(struct net_device *dev)
 
 err_netdev:
 	unregister_netdev(dev);
-	free_netdev(dev);
 err_hw:
 	ltq_etop_hw_exit(dev);
 	return err;
@@ -672,7 +671,8 @@ ltq_etop_probe(struct platform_device *pdev)
 		goto err_out;
 	}
 
-	dev = alloc_etherdev_mq(sizeof(struct ltq_etop_priv), 4);
+	dev = devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct ltq_etop_priv),
+				      4, 4);
 	if (!dev) {
 		err = -ENOMEM;
 		goto err_out;
@@ -690,13 +690,13 @@ ltq_etop_probe(struct platform_device *pdev)
 	err = device_property_read_u32(&pdev->dev, "lantiq,tx-burst-length", &priv->tx_burst_len);
 	if (err < 0) {
 		dev_err(&pdev->dev, "unable to read tx-burst-length property\n");
-		goto err_free;
+		goto err_out;
 	}
 
 	err = device_property_read_u32(&pdev->dev, "lantiq,rx-burst-length", &priv->rx_burst_len);
 	if (err < 0) {
 		dev_err(&pdev->dev, "unable to read rx-burst-length property\n");
-		goto err_free;
+		goto err_out;
 	}
 
 	for (i = 0; i < MAX_DMA_CHAN; i++) {
@@ -711,13 +711,11 @@ ltq_etop_probe(struct platform_device *pdev)
 
 	err = register_netdev(dev);
 	if (err)
-		goto err_free;
+		goto err_out;
 
 	platform_set_drvdata(pdev, dev);
 	return 0;
 
-err_free:
-	free_netdev(dev);
 err_out:
 	return err;
 }
-- 
2.46.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ