From: Dan Carpenter Date: Thu, 4 Sep 2014 11:09:15 +0000 (+0300) Subject: Btrfs: kfree()ing ERR_PTRs X-Git-Tag: fixes-for-v3.18-merge-window~139^2~2 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c47ca32d3aadb234f73389a34c97574085bc9eda;p=pandora-kernel.git Btrfs: kfree()ing ERR_PTRs The "inherit" in btrfs_ioctl_snap_create_v2() and "vol_args" in btrfs_ioctl_rm_dev() are ERR_PTRs so we can't call kfree() on them. These kind of bugs are "One Err Bugs" where there is just one error label that does everything. I could set the "inherit = NULL" and keep the single out label but it ends up being more complicated that way. It makes the code simpler to re-order the unwind so it's in the mirror order of the allocation and introduce some new error labels. Signed-off-by: Dan Carpenter Signed-off-by: Chris Mason --- Reading git-diff-tree failed