]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: fix return of uninitialized value in variable error
authorColin Ian King <colin.king@canonical.com>
Wed, 30 Jun 2021 22:38:57 +0000 (18:38 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 30 Jun 2021 22:38:57 +0000 (18:38 -0400)
commit9dc99f951d8e6e9acf644515161da543223e60ce
tree64f9ffeffea403770bda7dd6e9ca36335a75f82f
parent4acdeb816f0524f55e4f4783b7e85259f892f713
xfs: fix return of uninitialized value in variable error

Source kernel commit: 3b6dd9a9aeeada19d0c820ff68e979243a888bb6

A previous commit removed a call to xfs_attr3_leaf_read that
assigned an error return code to variable error. We now have
a few early error return paths to label 'out' that return
error if error is set; however error now is uninitialized
so potentially garbage is being returned.  Fix this by setting
error to zero to restore the original behaviour where error
was zero at the label 'restart'.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 07120f1abdff ("xfs: Add xfs_has_attr and subroutines")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_attr.c