From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp1040.oracle.com ([141.146.126.69]:35362 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751177AbdAUEsu (ORCPT ); Fri, 20 Jan 2017 23:48:50 -0500 Date: Sat, 21 Jan 2017 07:48:19 +0300 From: Dan Carpenter To: Andrew Morton , Fabian Frederick Cc: Al Viro , Jan Kara , Boaz Harrosh , Miklos Szeredi , linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] fs/affs: affs_bread() doesn't return ERR_PTRs Message-ID: <20170121044819.GA15269@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: We're checking IS_ERR() here, but we should be checking for NULL. Fixes: e393e82a7d09 ("fs/affs: make export work with cold dcache") Signed-off-by: Dan Carpenter diff --git a/fs/affs/namei.c b/fs/affs/namei.c index a3df8a6..706dd06 100644 --- a/fs/affs/namei.c +++ b/fs/affs/namei.c @@ -453,8 +453,8 @@ static struct dentry *affs_get_parent(struct dentry *child) struct buffer_head *bh; bh = affs_bread(child->d_sb, d_inode(child)->i_ino); - if (IS_ERR(bh)) - return ERR_CAST(bh); + if (bh) + return ERR_PTR(-EIO); parent = affs_iget(child->d_sb, be32_to_cpu(AFFS_TAIL(child->d_sb, bh)->parent));