Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9409335pxu; Mon, 28 Dec 2020 15:33:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaG+Hmzj7Xuk9AsJbNKsDlBVLG/zZR4yaICwv4rl6TTu5KeIrV9+bYk+MUAafVgq7lOv3s X-Received: by 2002:a50:e719:: with SMTP id a25mr43960757edn.12.1609198391134; Mon, 28 Dec 2020 15:33:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609198391; cv=none; d=google.com; s=arc-20160816; b=IA5ZilHGZLKMc3lY0LRhncDzf32RYqnsaLpp7+u8eCv1KA0dwm5/VVg+hxV1M8Bz6R LAFnyTmMgHotshbAZXKHQ7I9p1tynWptJCq0xKoWh9TYHCWsTEMRyN1KMzVuk1Th6bpE uCt2Ewc09TTBIQL/T7R3MhE7OOhDtboYuHo0TkyJLkTdkUZUfDm6rCXmYu99Slkt+AqP GhxdHE7JnG8Nf/7eSDV3a34M3tKGXqbY4T4gBylbh1EzMPvcFWPHkcxCC8aDIro+bOE+ Dkl0fWSspxcxv+RcLK8rr1qVoLJv6sxpuh9PielUn9UsS5H/i/7WvliEXXB23mhCd28G 52zA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IOb1LebNoqJn4bqNLzMHU+rI7rhbmsKkOPnJyMVHlOQ=; b=pSgRBMEA4q0YniU0NruMJlDiF8sf/KfERjcUOa1P4IJm/mJb7Sxnjp/yrRF4A7JeMa Zj8fEF4TQy7haLEfqYGRsTkfBO/VwGgqpENPKQ5uTF6w+RY6WntY9t5YF7K9Y+n0KMMu eesxnlxfNLZlW9kEkZ6mGKxDPEF8RuZqW4lqKPdIKbzVQWw9tSR3ByECIq/qxNHWfoio g1s+TW0cjFGLHy2o7HABVHFobvX8Zbe6mkOAUBbwdFmwi2MQ3q91wO4RswJkpy3XTboy N8vKkdDwcNfmhHGRpP8vXoDVbXFwBt4nUKsZSfv503mhwUCQhb80G4lyvUq2rmvNMc35 LkAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hWZfSGfp; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t12si25543758edc.228.2020.12.28.15.32.49; Mon, 28 Dec 2020 15:33:11 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=hWZfSGfp; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502563AbgL1O1z (ORCPT + 99 others); Mon, 28 Dec 2020 09:27:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:35156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502271AbgL1O1X (ORCPT ); Mon, 28 Dec 2020 09:27:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4A6EF20731; Mon, 28 Dec 2020 14:26:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165603; bh=ClAFoqKd4rQlBjNQV5GkKaU1Hf441krcqAmQs/nsaDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hWZfSGfptHcM6aWrSlXx5dEqr4wpv9ODhW7H2glXk85imHC+9HhOaBfVZ2X3zgj+2 sVCNfOtAQqvQqA/vap7Qtg+VlsD4Vp+G2IP011bvduvcLxRVOs1qh21O39AEGgyuol f2FSpvZ8E1xs4Dhr7tH05Ewao/702pkQ/VhoNK74= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Jan Kara , Theodore Tso , stable@kernel.org Subject: [PATCH 5.10 590/717] ext4: fix an IS_ERR() vs NULL check Date: Mon, 28 Dec 2020 13:49:48 +0100 Message-Id: <20201228125049.178226312@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter commit bc18546bf68e47996a359d2533168d5770a22024 upstream. The ext4_find_extent() function never returns NULL, it returns error pointers. Fixes: 44059e503b03 ("ext4: fast commit recovery path") Signed-off-by: Dan Carpenter Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20201023112232.GB282278@mwanda Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/extents.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -5815,8 +5815,8 @@ int ext4_ext_replay_update_ex(struct ino int ret; path = ext4_find_extent(inode, start, NULL, 0); - if (!path) - return -EINVAL; + if (IS_ERR(path)) + return PTR_ERR(path); ex = path[path->p_depth].p_ext; if (!ex) { ret = -EFSCORRUPTED;