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] [day] [month] [year] [list]
Message-ID: <a041b9a4-213f-47ae-ad33-6152213ad376@kernel.org>
Date: Thu, 4 Jan 2024 06:22:52 -0600
From: Dinh Nguyen <dinguyen@...nel.org>
To: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: kernel@...gutronix.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 09/11] firmware: stratix10-svc: Convert to platform remove
 callback returning void

On 12/27/23 10:26, Uwe Kleine-König wrote:
> 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 ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> 
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new(), which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> ---
>   drivers/firmware/stratix10-svc.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
> index c693da60e9a9..528f37417aea 100644
> --- a/drivers/firmware/stratix10-svc.c
> +++ b/drivers/firmware/stratix10-svc.c
> @@ -1251,7 +1251,7 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev)
>   	return ret;
>   }
>   
> -static int stratix10_svc_drv_remove(struct platform_device *pdev)
> +static void stratix10_svc_drv_remove(struct platform_device *pdev)
>   {
>   	struct stratix10_svc *svc = dev_get_drvdata(&pdev->dev);
>   	struct stratix10_svc_controller *ctrl = platform_get_drvdata(pdev);
> @@ -1267,13 +1267,11 @@ static int stratix10_svc_drv_remove(struct platform_device *pdev)
>   	if (ctrl->genpool)
>   		gen_pool_destroy(ctrl->genpool);
>   	list_del(&ctrl->node);
> -
> -	return 0;
>   }
>   
>   static struct platform_driver stratix10_svc_driver = {
>   	.probe = stratix10_svc_drv_probe,
> -	.remove = stratix10_svc_drv_remove,
> +	.remove_new = stratix10_svc_drv_remove,
>   	.driver = {
>   		.name = "stratix10-svc",
>   		.of_match_table = stratix10_svc_drv_match,

Acked-by: Dinh Nguyen <dinguyen@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ