From c66ea8566d18230ce20b55640b25a06f6f56ec7d Mon Sep 17 00:00:00 2001 From: Harpreet Lalwani Date: Tue, 23 Oct 2018 18:23:53 +0530 Subject: posix: Null pointer dereferencing clang fix Added a check for "top" Updates: bz#1622665 Change-Id: I354fdc7150b2f1eb452702ddb653e2d6ed609c10 Signed-off-by: Harpreet Lalwani --- xlators/storage/posix/src/posix-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/storage/posix/src/posix-helpers.c') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index be0bd06f0b0..fcd4b3ccf3f 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -2062,7 +2062,7 @@ abort: if (ret == 0) kill(getpid(), SIGKILL); - } else { + } else if (top) { LOCK(&ctx->volfile_lock); for (trav_p = &top->children; *trav_p; trav_p = &(*trav_p)->next) { victim = (*trav_p)->xlator; -- cgit