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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1468016848.9164.16.camel@linux.intel.com>
Date:	Fri, 08 Jul 2016 15:27:28 -0700
From:	J Freyensee <james_p_freyensee@...ux.intel.com>
To:	weiyj_lk@....com, Christoph Hellwig <hch@....de>,
	Sagi Grimberg <sagi@...mberg.me>
Cc:	Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
	linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org
Subject: Re: [PATCH -next] nvmet: fix return value check in
 nvmet_subsys_alloc()

On Wed, 2016-07-06 at 12:02 +0000, weiyj_lk@....com wrote:
> From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
> 
> In case of error, the function kstrndup() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check
> should be replaced with NULL test.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>

Looks good and inline with how other drivers use kstrndup(), thanks for
the fix.

Reviewed-by: Jay Freyensee <james_p_freyensee@...ux.intel.com>

> ---
>  drivers/nvme/target/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
> index e0b3f01..8a891ca 100644
> --- a/drivers/nvme/target/core.c
> +++ b/drivers/nvme/target/core.c
> @@ -895,7 +895,7 @@ struct nvmet_subsys *nvmet_subsys_alloc(const
> char *subsysnqn,
>  	subsys->type = type;
>  	subsys->subsysnqn = kstrndup(subsysnqn, NVMF_NQN_SIZE,
>  			GFP_KERNEL);
> -	if (IS_ERR(subsys->subsysnqn)) {
> +	if (!subsys->subsysnqn) {
>  		kfree(subsys);
>  		return NULL;
>  	}
> 
> 
> 
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ