This is caused by assert(). If assert is disabled we run into use
of uninitialized variables. Return -EINVAL in case assert() is
disabled.
Fix for:
[src/client/Client.cc:7791]: (error) Uninitialized variable: lock_state
[src/client/Client.cc:7829]: (error) Uninitialized variable: lock_type
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
if (!in->flock_locks)
in->flock_locks = new ceph_lock_state_t(cct);
lock_state = in->flock_locks;
- } else
+ } else {
assert(0);
+ return -EINVAL;
+ }
_update_lock_state(fl, owner, lock_state);
if (fh) {
lock_type = CEPH_LOCK_FLOCK_INTR;
else if (req->head.args.filelock_change.rule == CEPH_LOCK_FCNTL)
lock_type = CEPH_LOCK_FCNTL_INTR;
- else
+ else {
assert(0);
+ return -EINVAL;
+ }
MetaRequest *intr_req = new MetaRequest(CEPH_MDS_OP_SETFILELOCK);
filepath path;