scoutfs: Don't destroy sroot unless srch_search_xattrs() was called

Until then, sroot is uninitialized so it's not safe to call
destroy_rb_root().

Signed-off-by: Andy Grover <agrover@versity.com>
This commit is contained in:
Andy Grover
2020-12-03 09:02:31 -08:00
committed by Zach Brown
parent 9375b9d3b7
commit 1bef610416
+3 -1
View File
@@ -836,8 +836,10 @@ static long scoutfs_ioc_search_xattrs(struct file *file, unsigned long arg)
ret = -EFAULT;
else
ret = 0;
out:
scoutfs_srch_destroy_rb_root(&sroot);
out:
kfree(name);
return ret ?: total;
}