diff options
author | Varsha Rao <varao@redhat.com> | 2018-10-18 12:03:37 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-10-22 04:33:18 +0000 |
commit | ac9976f0c52306f4f2d9b11dcf6a830d1ec2e445 (patch) | |
tree | b1635b573a96f3e561b1ef11ae58ef0319c15ac7 | |
parent | e1a9c23b83b8d46bf44a7a9952da0c61c8a46c79 (diff) |
performance/write-behind: Fix NULL dereference issue
This patches fixes the following coverity issues:
CID: 1396101, 1396102 - Dereference null return value.
Change-Id: I7ec783a61c06a1378863e974ff6e0baae418aec2
updates: bz#789278
Signed-off-by: Varsha Rao <varao@redhat.com>
-rw-r--r-- | xlators/performance/write-behind/src/write-behind.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index ad226932852..473c8e9320a 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -2471,7 +2471,7 @@ wb_mark_readdirp_start(xlator_t *this, inode_t *directory) wb_directory_inode = wb_inode_create(this, directory); - if (!wb_directory_inode->lock.spinlock) + if (!wb_directory_inode || !wb_directory_inode->lock.spinlock) return; LOCK(&wb_directory_inode->lock); @@ -2491,7 +2491,7 @@ wb_mark_readdirp_end(xlator_t *this, inode_t *directory) wb_directory_inode = wb_inode_ctx_get(this, directory); - if (!wb_directory_inode->lock.spinlock) + if (!wb_directory_inode || !wb_directory_inode->lock.spinlock) return; LOCK(&wb_directory_inode->lock); |