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>] [day] [month] [year] [list]
Message-ID: <20241109092202.4040669-1-zhangheng@kylinos.cn>
Date: Sat,  9 Nov 2024 17:22:02 +0800
From: zhangheng <zhangheng@...inos.cn>
To: corbet@....net,
	matthias.bgg@...il.com,
	angelogioacchino.delregno@...labora.com
Cc: linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-mediatek@...ts.infradead.org,
	zhangheng <zhangheng@...inos.cn>
Subject: [PATCH 4/4] docs: driver-api: firmware_loader: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void.

Trivially convert the mediatek drm drivers from always returning zero in
the remove callback to the void returning variant.

Signed-off-by: zhangheng <zhangheng@...inos.cn>
---
 Documentation/driver-api/firmware/fw_upload.rst | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Documentation/driver-api/firmware/fw_upload.rst b/Documentation/driver-api/firmware/fw_upload.rst
index edf1d0c5e7c3..b339265655ee 100644
--- a/Documentation/driver-api/firmware/fw_upload.rst
+++ b/Documentation/driver-api/firmware/fw_upload.rst
@@ -69,13 +69,12 @@ function calls firmware_upload_unregister() such as::
 		return 0;
 	}
 
-	static int m10bmc_sec_remove(struct platform_device *pdev)
+	static void m10bmc_sec_remove(struct platform_device *pdev)
 	{
 		struct m10bmc_sec *sec = dev_get_drvdata(&pdev->dev);
 
 		firmware_upload_unregister(sec->fwl);
 		kfree(sec->fw_name);
-		return 0;
 	}
 
 firmware_upload_register
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ