]> git.baikalelectronics.ru Git - kernel.git/commitdiff
xfs: fix uninitialized variable in xfs_attr3_leaf_inactive
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 5 Oct 2022 07:01:04 +0000 (12:31 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2022 07:16:57 +0000 (09:16 +0200)
commit 4367863c8fc7eb6a56fd46e8470332f92631320e 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: 92ee175e92e8 ("xfs: streamline xfs_attr3_leaf_inactive")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_attr_inactive.c

index 1f331d51a901715605efc15c583d1727b56c3c2d..9c88203b537b1b6fb0878fcbf8c096a37887b3f0 100644 (file)
@@ -88,7 +88,7 @@ xfs_attr3_leaf_inactive(
        struct xfs_attr_leafblock       *leaf = bp->b_addr;
        struct xfs_attr_leaf_entry      *entry;
        struct xfs_attr_leaf_name_remote *name_rmt;
-       int                             error;
+       int                             error = 0;
        int                             i;
 
        xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);