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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YRdkDvF+BhGsKakD@kroah.com>
Date:   Sat, 14 Aug 2021 08:34:54 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Salah Triki <salah.triki@...il.com>
Cc:     Keith Packard <keithp@...thp.com>, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: misc: chaoskey: remove useless else

On Fri, Aug 13, 2021 at 05:40:49PM +0100, Salah Triki wrote:
> Remove useless else in order to make the code cleaner.
> 
> Signed-off-by: Salah Triki <salah.triki@...il.com>
> ---
>  drivers/usb/misc/chaoskey.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c
> index 87067c3d6109..9814ac2201d5 100644
> --- a/drivers/usb/misc/chaoskey.c
> +++ b/drivers/usb/misc/chaoskey.c
> @@ -299,14 +299,11 @@ static int chaoskey_release(struct inode *inode, struct file *file)
>  
>  	--dev->open;
>  
> -	if (!dev->present) {
> -		if (dev->open == 0) {
> -			mutex_unlock(&dev->lock);
> +	mutex_unlock(&dev->lock);
> +
> +	if (!dev->present)
> +		if (dev->open == 0)
>  			chaoskey_free(dev);
> -		} else
> -			mutex_unlock(&dev->lock);
> -	} else
> -		mutex_unlock(&dev->lock);
>  
>  	usb_dbg(interface, "release success");
>  	return 0;
> -- 
> 2.25.1
> 

Please fix whatever tool "found" this code to be changed so that it does
not introduce bugs again, that's a broken tool.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ