Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp85211yba; Mon, 20 May 2019 05:27:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwf7vjuqQgnT3vvfVIm+h0T4Lvqk13MriszAb0uA9LeMyE5B/cDIDaik6PmXcy97NI3ZqbW X-Received: by 2002:a63:231c:: with SMTP id j28mr75002462pgj.430.1558355220556; Mon, 20 May 2019 05:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558355220; cv=none; d=google.com; s=arc-20160816; b=Tr6HX3ajMznvPG/74NCt2kUVb1hs613uISNpOQY4Zee621GpBzAjz2x5UwhC31EscD YPo8LpaUAL2YBtrkF9h60h/49G8phgOavQ+h8Z806Tu0QmTpi2bxZLreu5TbOMwlifK9 nSKNxWUd0LsBeJvGIkm9AWNCNE3ziY2sXG/OF78k08iLUHw01gipKXaNAPTpVWY7xmoi To+tZJsV8lfeYY5kp8yjlWL1O5ljk6WxVces48h6TmtzUyJ/2ziusnVARXZCSpMlZLi3 WL8ycfZOVwOiSggdufYIjZENP4kKuk8zNXRnJYBbKtDzRS2uBKRcQq2DqfOMrCxXBDVG mBXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uFVzkdy3TXllBDATDkXhcAl0h1GIjD83YuHG2vW1zXw=; b=QJdyVyQAHdlOmoUOQixEp3P1ezE6twGKoeeA6LiR/IEXwbExMdquMtJV1AYHDMgp0e KxJMnlbfBCP4LtToW/Tw8VUv4YDpEuFwT+5azugRYbzgLxIfejlkgXS6VN1PrGuChEMC 1hAFYoTNdCqO1M2Fr3AOs/T9Y7Y6LfD7R5kB7ck98TVvYSGhDCiZSZM43xaIRDAFIN8k 3JPc8LHFQi8wyimFXrJGJYRBryFzhajLETRR/N1/mRl+bHY0F4Z2KDXf56WesZF/NNs3 OPUAEc+y71CVc2kqY3yDp3EJQDzcDoLj0YSOsjITF1uCNDB6k2jkl291pdbElDGSZn3t hTMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w5SLnySF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si17980622pln.43.2019.05.20.05.26.46; Mon, 20 May 2019 05:27:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w5SLnySF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389022AbfETMZN (ORCPT + 99 others); Mon, 20 May 2019 08:25:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:40238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389015AbfETMZM (ORCPT ); Mon, 20 May 2019 08:25:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8ACF420815; Mon, 20 May 2019 12:25:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558355112; bh=CaVc0Vmf0CTBvhnD/hDvXM9q76PEYULHxwWmImXaQsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w5SLnySF24iZH8gY8UuvFp8C2qqzIvhZoGWWoOMetDSEr6jOIrKx8BVbsNp9BLz08 J+N/3COhw0pNDNcOmdRNPyAS8dqPIAtVbDieqG9+DbFMxF+TWp6tDfoJoojN3B0rE1 ardcI4beoNd3tjEHxXikO8nPYdD0xAOaKaQ1BKR0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Theodore Tso Subject: [PATCH 4.19 102/105] ext4: unsigned int compared against zero Date: Mon, 20 May 2019 14:14:48 +0200 Message-Id: <20190520115254.280651714@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115247.060821231@linuxfoundation.org> References: <20190520115247.060821231@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King commit fbbbbd2f28aec991f3fbc248df211550fbdfd58c upstream. There are two cases where u32 variables n and err are being checked for less than zero error values, the checks is always false because the variables are not signed. Fix this by making the variables ints. Addresses-Coverity: ("Unsigned compared against 0") Fixes: 345c0dbf3a30 ("ext4: protect journal inode's blocks using block_validity") Signed-off-by: Colin Ian King Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/block_validity.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/ext4/block_validity.c +++ b/fs/ext4/block_validity.c @@ -142,7 +142,8 @@ static int ext4_protect_reserved_inode(s struct inode *inode; struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_map_blocks map; - u32 i = 0, err = 0, num, n; + u32 i = 0, num; + int err = 0, n; if ((ino < EXT4_ROOT_INO) || (ino > le32_to_cpu(sbi->s_es->s_inodes_count)))