From e7aeab3063ac5645136303278b477d7de35266c0 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 20 May 2019 11:11:39 +0530 Subject: across: clang-scan: fix NULL dereferencing warnings All these checks are done after analyzing clang-scan report produced by the CI job @ https://build.gluster.org/job/clang-scan updates: bz#1622665 Change-Id: I590305af4ceb779be952974b2a36066ffc4865ca Signed-off-by: Amar Tumballi --- 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 7296f698db0..bab79f42c2f 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -2416,7 +2416,7 @@ posix_fsyncer_process(xlator_t *this, call_stub_t *stub, gf_boolean_t do_fsync) return; } - if (do_fsync) { + if (do_fsync && pfd) { if (stub->args.datasync) ret = sys_fdatasync(pfd->fd); else -- cgit