From nobody Sun Dec 14 06:17:02 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 816EBC433F5 for ; Wed, 5 Oct 2022 11:38:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbiJELiS (ORCPT ); Wed, 5 Oct 2022 07:38:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbiJELha (ORCPT ); Wed, 5 Oct 2022 07:37:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0827C5F7D2; Wed, 5 Oct 2022 04:35:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 12039B81DBC; Wed, 5 Oct 2022 11:34:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66D02C433D6; Wed, 5 Oct 2022 11:34:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664969694; bh=6xJcFc9dGQ5BNpTfJqZ6QZWR7Ia24f+OL1DRDtn1inU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eiVm6vuE2JUEaVuBx/W7McbEkrCSrmofiF484Q03gJUn+S+fXwEhTi1RuBL5EyF/b cWBbxAxVoNdu3pxCI9sn9bqL7MktQltC00PS6ghm+QgaaiQSC1/fFKGarFo9Pv5vfG kbEAdrJNmRsuoweEhl62wES5a6HFutptHDKYW9wU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , "Darrick J. Wong" , Allison Collins , Eric Sandeen , "Darrick J. Wong" , Chandan Babu R Subject: [PATCH 5.4 47/51] xfs: fix uninitialized variable in xfs_attr3_leaf_inactive Date: Wed, 5 Oct 2022 13:32:35 +0200 Message-Id: <20221005113212.438169634@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221005113210.255710920@linuxfoundation.org> References: <20221005113210.255710920@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: "Darrick J. Wong" commit 54027a49938bbee1af62fad191139b14d4ee5cd2 upstream. Dan Carpenter pointed out that error is uninitialized. While there never should be an attr leaf block with zero entries, let's not leave that logic bomb there. Fixes: 0bb9d159bd01 ("xfs: streamline xfs_attr3_leaf_inactive") Reported-by: Dan Carpenter Signed-off-by: Darrick J. Wong Reviewed-by: Allison Collins Reviewed-by: Eric Sandeen Acked-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_attr_inactive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/xfs/xfs_attr_inactive.c +++ b/fs/xfs/xfs_attr_inactive.c @@ -88,7 +88,7 @@ xfs_attr3_leaf_inactive( struct xfs_attr_leafblock *leaf =3D bp->b_addr; struct xfs_attr_leaf_entry *entry; struct xfs_attr_leaf_name_remote *name_rmt; - int error; + int error =3D 0; int i; =20 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);