xfs: fix uninitialized variable in _reflink_convert_cow
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 14 Feb 2017 06:52:27 +0000 (22:52 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Apr 2017 07:30:31 +0000 (09:30 +0200)
commit 93aaead52a9eebdc20dc8fa673c350e592a06949 upstream.

Fix an uninitialize variable.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_reflink.c

index 36c07b1..eff070a 100644 (file)
@@ -363,7 +363,7 @@ xfs_reflink_convert_cow(
        xfs_fileoff_t           end_fsb = XFS_B_TO_FSB(mp, offset + count);
        xfs_extnum_t            idx;
        bool                    found;
-       int                     error;
+       int                     error = 0;
 
        xfs_ilock(ip, XFS_ILOCK_EXCL);