From: Miao Xie Date: Thu, 7 Feb 2013 06:02:44 +0000 (+0000) Subject: Btrfs: fix memory leak of pending_snapshot->inherit X-Git-Tag: v3.9-rc1~17^2~29^2~21 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8696c53304f16fde9368b9d5c89a5acb4a815d4c;p=pandora-kernel.git Btrfs: fix memory leak of pending_snapshot->inherit The argument "inherit" of btrfs_ioctl_snap_create_transid() was assigned to NULL during we created the snapshots, so we didn't free it though we called kfree() in the caller. But since we are sure the snapshot creation is done after the function - btrfs_ioctl_snap_create_transid() - completes, it is safe that we don't assign the pointer "inherit" to NULL, and just free it in the caller of btrfs_ioctl_snap_create_transid(). In this way, the code can become more readable. Reported-by: Alex Lyakas Cc: Arne Jansen Signed-off-by: Miao Xie Signed-off-by: Josef Bacik --- Reading git-diff-tree failed