summaryrefslogtreecommitdiff
path: root/lib/strncpy_from_user.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-05-19 13:13:15 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-10 12:41:36 +0200
commit9d20683fb38d7e990a03d7c4423f1bae72139520 (patch)
treedf906856f854e413c5c9d4658395c7c8b9192ce7 /lib/strncpy_from_user.c
parenteb6875d48590d8e564092e831ff07fa384d7e477 (diff)
btrfs: fixup error handling in fixup_inode_link_counts
commit 011b28acf940eb61c000059dd9e2cfcbf52ed96b upstream. This function has the following pattern while (1) { ret = whatever(); if (ret) goto out; } ret = 0 out: return ret; However several places in this while loop we simply break; when there's a problem, thus clearing the return value, and in one case we do a return -EIO, and leak the memory for the path. Fix this by re-arranging the loop to deal with ret == 1 coming from btrfs_search_slot, and then simply delete the ret = 0; out: bit so everybody can break if there is an error, which will allow for proper error handling to occur. CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/strncpy_from_user.c')
0 files changed, 0 insertions, 0 deletions