Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4200902pxu; Mon, 12 Oct 2020 12:05:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv9Z7Kss4Fv/P3l6l+9DYaH/y3HBZ2XemV2GSP7zpf2KIgF9JjXZYxuLZ/aqQnwjTACz9r X-Received: by 2002:a50:e40b:: with SMTP id d11mr15916436edm.198.1602529538748; Mon, 12 Oct 2020 12:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602529538; cv=none; d=google.com; s=arc-20160816; b=Ca3kpldM+DzVKQz/xM9ATl2CYrGVqUzBriK6kYujEJU1IBZOcGkHG4yOG4WCPNL5Yl vCqksWeHFYrHqACFr8NM0KupXRSB7kUXPgbQ2OVUfpRd1H9IVempW3PruylvJRyBXvkH 7hHFhzKp8hWaoAgOw1P7PBNd9p2dQC87SLU5j8lC/fb9O3pJ9E0f3K4dyv0/T2vrQwS2 yeMZ7on9Th7ROSMId0hewwpp7FhZHaYGaa7CLuMXbWlhGeL0P2pvReofieMBhVtVUO5S FYpnocVykvIzDkwEppxVAkm7PzygoRbFRn7rfHYPEi+PdObu0l5P6FqhlIDcBhG1O/si mm0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R3PkGieXHM2Z0T3EPgzAVuFP094sjzTbZcn3XTcHEIM=; b=l29qprKsfKdJQCcO2rJW36fJ4vprRW0URndP0iZJdQMxM0Orr2D1y3lopBwTiJ3wIH dEPaym81UMxXTq3CDXTDUAklCm/zGi7qb7WU0Xrmw1z31T+R35lYPIEpP+85PJ1ibV4P QguReXBzVArqjc4iyZtMeBF4spIbR1glv/rbI+V0oNfmMJU2jJNog1S21AqdQNr0ZUDD /+776GN8ZYKjqB1XT+xT5BDFbwdWjYV6i2iwb3Bt5VfKdg+ldF9D+M6Od38RagWT22Wa b0vuuIee1/AD6BN43FY4924Uwvh0Lbqzv91IpC1kQ7cqjOVrR24zxyzoaLgJxDj17Zsx +CMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qOaIM8ku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f3si12854365ejz.386.2020.10.12.12.05.04; Mon, 12 Oct 2020 12:05:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qOaIM8ku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390936AbgJLTDc (ORCPT + 99 others); Mon, 12 Oct 2020 15:03:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:52546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390065AbgJLTDJ (ORCPT ); Mon, 12 Oct 2020 15:03:09 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 943C12073A; Mon, 12 Oct 2020 19:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602529388; bh=KyFwZq91g0c69Vtm1zs1HoCWvTLdAGjQ987vXshT4rQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qOaIM8kuiYRRtVKh+yZFV16ckGXnJbepaSp/mRVRG9gM/3grfBLQFuaV6tXptazwL oAkHEiadVJJbXe4OMT7w+FtU3OyLLeAjPcuhjNjG5vWQ+UOyZcvagVFP10qhPHjE0N GWPxKOu3Ugb9psa3iVN+2NdOXSvfdbIzmErDgK6w= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tetsuhiro Kohada , Namjae Jeon , Sasha Levin Subject: [PATCH AUTOSEL 5.8 22/24] exfat: fix pointer error checking Date: Mon, 12 Oct 2020 15:02:37 -0400 Message-Id: <20201012190239.3279198-22-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201012190239.3279198-1-sashal@kernel.org> References: <20201012190239.3279198-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tetsuhiro Kohada [ Upstream commit d6c9efd92443b23307995f34246c2374056ebbd8 ] Fix missing result check of exfat_build_inode(). And use PTR_ERR_OR_ZERO instead of PTR_ERR. Signed-off-by: Tetsuhiro Kohada Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin --- fs/exfat/namei.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index 2b9e21094a96d..4b53a3efd6d46 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -578,7 +578,8 @@ static int exfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, i_pos = exfat_make_i_pos(&info); inode = exfat_build_inode(sb, &info, i_pos); - if (IS_ERR(inode)) + err = PTR_ERR_OR_ZERO(inode); + if (err) goto unlock; inode_inc_iversion(inode); @@ -745,10 +746,9 @@ static struct dentry *exfat_lookup(struct inode *dir, struct dentry *dentry, i_pos = exfat_make_i_pos(&info); inode = exfat_build_inode(sb, &info, i_pos); - if (IS_ERR(inode)) { - err = PTR_ERR(inode); + err = PTR_ERR_OR_ZERO(inode); + if (err) goto unlock; - } i_mode = inode->i_mode; alias = d_find_alias(inode); @@ -890,10 +890,9 @@ static int exfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) i_pos = exfat_make_i_pos(&info); inode = exfat_build_inode(sb, &info, i_pos); - if (IS_ERR(inode)) { - err = PTR_ERR(inode); + err = PTR_ERR_OR_ZERO(inode); + if (err) goto unlock; - } inode_inc_iversion(inode); inode->i_mtime = inode->i_atime = inode->i_ctime = -- 2.25.1