From: Chen Yang <chenyang.f...@cn.fujitsu.com>

When open_ctree(device, ...) failed, the return value should be checked.

Signed-off-by: Cheng Yang <chenyang.f...@cn.fujitsu.com>
Signed-off-by: Gene Czarcinski <g...@czarc.net>
---
 btrfstune.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/btrfstune.c b/btrfstune.c
index 47830c5..07648d5 100644
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -107,6 +107,8 @@ int main(int argc, char *argv[])
        }
 
        root = open_ctree(device, 0, 1);
+       if (!root)
+               return 1;
 
        if (seeding_flag) {
                ret = update_seeding_flag(root, seeding_value);
-- 
1.8.1

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

Reply via email to