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: <20221125002347.i2ftoscee43fcb2e@mercury.elektranox.org>
Date:   Fri, 25 Nov 2022 01:23:47 +0100
From:   Sebastian Reichel <sebastian.reichel@...labora.com>
To:     Yuan Can <yuancan@...wei.com>
Cc:     linmq006@...il.com, pavel@....cz, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HSI: omap_ssi_core: Fix error handling in ssi_init()

Hi,

On Thu, Nov 24, 2022 at 11:33:32AM +0000, Yuan Can wrote:
> The ssi_init() returns the platform_driver_register() directly without
> checking its return value, if platform_driver_register() failed, the
> ssi_pdriver is not unregistered.
> Fix by unregister ssi_pdriver when the last platform_driver_register()
> failed.
> 
> Fixes: 0fae198988b8 ("HSI: omap_ssi: built omap_ssi and omap_ssi_port into one module")
> Signed-off-by: Yuan Can <yuancan@...wei.com>
> ---

Thanks, queued.

-- Sebastian

>  drivers/hsi/controllers/omap_ssi_core.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c
> index 052cf3e92dd6..26f2c3c01297 100644
> --- a/drivers/hsi/controllers/omap_ssi_core.c
> +++ b/drivers/hsi/controllers/omap_ssi_core.c
> @@ -631,7 +631,13 @@ static int __init ssi_init(void) {
>  	if (ret)
>  		return ret;
>  
> -	return platform_driver_register(&ssi_port_pdriver);
> +	ret = platform_driver_register(&ssi_port_pdriver);
> +	if (ret) {
> +		platform_driver_unregister(&ssi_pdriver);
> +		return ret;
> +	}
> +
> +	return 0;
>  }
>  module_init(ssi_init);
>  
> -- 
> 2.17.1
> 

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ