From patchwork Sat Jan 21 04:48:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 9529771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C41716046A for ; Sat, 21 Jan 2017 04:49:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8B5728687 for ; Sat, 21 Jan 2017 04:49:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACE5F286C9; Sat, 21 Jan 2017 04:49:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DF7928698 for ; Sat, 21 Jan 2017 04:49:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752737AbdAUEsv (ORCPT ); Fri, 20 Jan 2017 23:48:51 -0500 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 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v0L4ma2S018193 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 21 Jan 2017 04:48:37 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v0L4mXTQ022102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 21 Jan 2017 04:48:33 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v0L4mVmU023515; Sat, 21 Jan 2017 04:48:31 GMT Received: from mwanda (/154.0.138.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 20 Jan 2017 20:48:30 -0800 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-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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));