From: Miao Xie <[email protected]>

if passing NULL to btrfs_free_path(),oops will happen. so we must check the
pointer passed to it.

Signed-off-by: Miao Xie <[email protected]>
---
 fs/btrfs/relocation.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 0b23942..6737803 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -816,8 +816,10 @@ next:
                        list_add_tail(&edge->list[UPPER], &list);
        }
 out:
-       btrfs_free_path(path1);
-       btrfs_free_path(path2);
+       if (path1)
+               btrfs_free_path(path1);
+       if (path2)
+               btrfs_free_path(path2);
        if (err) {
                INIT_LIST_HEAD(&list);
                upper = node;
-- 
1.6.5.2


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to