From: Eric Sandeen Date: Thu, 12 Jun 2014 05:39:58 +0000 (-0500) Subject: btrfs: fix use of uninit "ret" in end_extent_writepage() X-Git-Tag: omap-for-v3.16/fixes-against-rc1~14^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e2426bd0eb980648449e7a2f5a23e3cd3c7725c;p=pandora-kernel.git btrfs: fix use of uninit "ret" in end_extent_writepage() If this condition in end_extent_writepage() is false: if (tree->ops && tree->ops->writepage_end_io_hook) we will then test an uninitialized "ret" at: ret = ret < 0 ? ret : -EIO; The test for ret is for the case where ->writepage_end_io_hook failed, and we'd choose that ret as the error; but if there is no ->writepage_end_io_hook, nothing sets ret. Initializing ret to 0 should be sufficient; if writepage_end_io_hook wasn't set, (!uptodate) means non-zero err was passed in, so we choose -EIO in that case. Signed-of-by: Eric Sandeen Signed-off-by: Chris Mason --- Reading git-diff-tree failed