On Sat, Oct 08, 2016 at 10:55:58AM -0500, Eric Sandeen wrote: > On 10/7/16 6:07 PM, Darrick J. Wong wrote: > > Eric Sandeen reported a gcc complaint about uninitialized error > > variables, so fix that. > > > > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > Reported-by: Eric Sandeen <sandeen@xxxxxxxxxx> > > --- > > fs/xfs/xfs_reflink.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c > > index 220d263..5965e94 100644 > > --- a/fs/xfs/xfs_reflink.c > > +++ b/fs/xfs/xfs_reflink.c > > @@ -1437,7 +1437,7 @@ xfs_reflink_dirty_extents( > > xfs_off_t flen; > > struct xfs_bmbt_irec map[2]; > > int nmaps; > > - int error; > > + int error = 0; > > > > while (end - fbno > 0) { > > If we should never get here w/ end <= fbno, then maybe an ASSERT is > in order. > > And if we ever do get here w/ that case, perhaps default error to a relevant > error so we don't return success and carry on in that case? Initializing it to -EINVAL plus an assert for debug builds sounds fine. -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html