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: <20131029150949.GA32008@mail.hallyn.com>
Date:	Tue, 29 Oct 2013 15:09:49 +0000
From:	"Serge E. Hallyn" <serge@...lyn.com>
To:	Wei Yongjun <weiyj.lk@...il.com>
Cc:	viro@...iv.linux.org.uk, ebiederm@...ssion.com,
	keescook@...omium.org, serge.hallyn@...onical.com,
	yongjun_wei@...ndmicro.com.cn, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] befs: fix return value check in befs_iget()

Quoting Wei Yongjun (weiyj.lk@...il.com):
> From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
> 
> In case of error, the function iget_locked() 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>

Acked-by: Serge Hallyn <serge.hallyn@...onical.com>

> ---
>  fs/befs/linuxvfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
> index e9c75e2..d714dda 100644
> --- a/fs/befs/linuxvfs.c
> +++ b/fs/befs/linuxvfs.c
> @@ -319,8 +319,8 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
>  	befs_debug(sb, "---> befs_read_inode() " "inode = %lu", ino);
>  
>  	inode = iget_locked(sb, ino);
> -	if (IS_ERR(inode))
> -		return inode;
> +	if (!inode)
> +		return ERR_PTR(-ENOMEM);
>  	if (!(inode->i_state & I_NEW))
>  		return inode;
>  
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ