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: <8b109cdf-3bc7-4342-b925-8eea533d73b4@suse.de>
Date:   Mon, 18 Jun 2018 21:44:00 +0800
From:   Coly Li <colyli@...e.de>
To:     Florian Schmaus <flo@...kplace.eu>,
        Kent Overstreet <kent.overstreet@...il.com>,
        linux-bcache@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] bcache: do not assign in if condition
 register_bcache()

On 2018/6/18 6:09 PM, Florian Schmaus wrote:
> Fixes an error condition reported by checkpatch.pl which is caused by
> assigning a variable in an if condition.
> 
> Signed-off-by: Florian Schmaus <flo@...kplace.eu>

Signed-off-by: Coly Li <colyli@...e.de>

Added into for-next patch set.

Thanks.

Coly Li

> ---
>  drivers/md/bcache/super.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index fa4058e43202..db7177d422e5 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -2163,8 +2163,12 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
>  	if (!try_module_get(THIS_MODULE))
>  		return -EBUSY;
>  
> -	if (!(path = kstrndup(buffer, size, GFP_KERNEL)) ||
> -	    !(sb = kmalloc(sizeof(struct cache_sb), GFP_KERNEL)))
> +	path = kstrndup(buffer, size, GFP_KERNEL);
> +	if (!path)
> +		goto err;
> +
> +	sb = kmalloc(sizeof(struct cache_sb), GFP_KERNEL);
> +	if (!sb)
>  		goto err;
>  
>  	err = "failed to open device";
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ