From 145e180517054626d07892219fdee689b703c218 Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Wed, 17 Oct 2018 15:40:04 +0530 Subject: shard : fix newly introduced coverity This patch fixes CID: 1396177: NULL dereference. updates: bz#789278 Change-Id: Ic5d302a5e32d375acf8adc412763ab94e6dabc3d Signed-off-by: Sunny Kumar --- xlators/features/shard/src/shard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators/features/shard/src') diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index d5f55efa0bc..9506b662fe2 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -2926,7 +2926,8 @@ shard_unlink_block_inode(shard_local_t *local, int shard_block_num) list_del_init(&ctx->to_fsync_list); if (base_inode) __shard_inode_ctx_get(base_inode, this, &base_ictx); - base_ictx->fsync_count--; + if (base_ictx) + base_ictx->fsync_count--; } } UNLOCK(&inode->lock); -- cgit