diff options
author | Iraj Jamali <ijamali@redhat.com> | 2018-09-24 15:12:25 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-09-26 04:11:37 +0000 |
commit | 5ad31b5b17fa220c9b26b6df730e127c76448ac5 (patch) | |
tree | a24c5f447f34bf576dcaae65a43e1ba46515348b /xlators | |
parent | 65aed1070cc2e44959cf3a0fbfde635de7e03103 (diff) |
features/locks: NULL pointer deferencing clang fix
Added checks to avoid NULL pointer dereferencing
Updates: bz#1622665
Change-Id: I8e441c2931f406a6012e418127550bdf454a599a
Signed-off-by: Iraj Jamali <ijamali@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/locks/src/posix.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 6b4392ec21d..de8b7109338 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -850,7 +850,7 @@ truncate_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } unwind: if (op_ret == -1) { - gf_log(this->name, GF_LOG_ERROR, + gf_log(this ? this->name : "locks", GF_LOG_ERROR, "truncate failed with " "ret: %d, error: %s", op_ret, strerror(op_errno)); @@ -902,7 +902,7 @@ pl_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, ret = 0; unwind: if (ret == -1) { - gf_log(this->name, GF_LOG_ERROR, + gf_log(this ? this->name : "locks", GF_LOG_ERROR, "truncate on %s failed with" " ret: %d, error: %s", loc->path, -1, strerror(ENOMEM)); @@ -935,7 +935,7 @@ pl_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, ret = 0; unwind: if (ret == -1) { - gf_log(this->name, GF_LOG_ERROR, + gf_log(this ? this->name : "locks", GF_LOG_ERROR, "ftruncate failed with" " ret: %d, error: %s", -1, strerror(ENOMEM)); |