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: <cc73ed8b-b51f-59bc-ef4b-5f7e4ab26828@kernel.org>
Date:   Wed, 11 May 2022 11:38:24 +0200
From:   Jiri Slaby <jirislaby@...nel.org>
To:     Zheng Bin <zhengbin13@...wei.com>, gregkh@...uxfoundation.org,
        linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     gaochao49@...wei.com
Subject: Re: [PATCH -next] tty: serial: max3100: Add missing
 uart_unregister_driver in max3100_probe

On 11. 05. 22, 9:15, Zheng Bin wrote:
> max3100_probe misses a call uart_unregister_driver in error path,
> this patch fixes that.

I believe, that's intentional. Cf. uart_driver_registered.

> Signed-off-by: Zheng Bin <zhengbin13@...wei.com>
> ---
>   drivers/tty/serial/max3100.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
> index 0b5f21fbb53d..6d34ca2a3f7b 100644
> --- a/drivers/tty/serial/max3100.c
> +++ b/drivers/tty/serial/max3100.c
> @@ -752,6 +752,7 @@ static int max3100_probe(struct spi_device *spi)
>   		if (!max3100s[i])
>   			break;
>   	if (i == MAX_MAX3100) {
> +		uart_unregister_driver(&max3100_uart_driver);
>   		dev_warn(&spi->dev, "too many MAX3100 chips\n");
>   		mutex_unlock(&max3100s_lock);
>   		return -ENOMEM;
> @@ -759,6 +760,7 @@ static int max3100_probe(struct spi_device *spi)
> 
>   	max3100s[i] = kzalloc(sizeof(struct max3100_port), GFP_KERNEL);
>   	if (!max3100s[i]) {
> +		uart_unregister_driver(&max3100_uart_driver);
>   		dev_warn(&spi->dev,
>   			 "kmalloc for max3100 structure %d failed!\n", i);
>   		mutex_unlock(&max3100s_lock);
> --
> 2.31.1
> 


-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ