In ldlm_handle_enqueue0() if ldlm_lock_create() fails then set lock to
NULL before jumping to the exit code. In the exit code test lock for
NULL rather than using IS_ERR().
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I5e2680988bd5356f2a84bd5eb9e2d40138d6d250
Reviewed-on: http://review.whamcloud.com/11197
Tested-by: Jenkins
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
dlm_req->lock_desc.l_resource.lr_type,
dlm_req->lock_desc.l_req_mode,
cbs, NULL, 0, LVB_T_NONE);
dlm_req->lock_desc.l_resource.lr_type,
dlm_req->lock_desc.l_req_mode,
cbs, NULL, 0, LVB_T_NONE);
- if (IS_ERR(lock))
- GOTO(out, rc = PTR_ERR(lock));
+ if (IS_ERR(lock)) {
+ rc = PTR_ERR(lock);
+ lock = NULL;
+ GOTO(out, rc);
+ }
lock->l_last_activity = cfs_time_current_sec();
lock->l_remote_handle = dlm_req->lock_handle[0];
lock->l_last_activity = cfs_time_current_sec();
lock->l_remote_handle = dlm_req->lock_handle[0];
/* The LOCK_CHANGED code in ldlm_lock_enqueue depends on this
* ldlm_reprocess_all. If this moves, revisit that code. -phil */
/* The LOCK_CHANGED code in ldlm_lock_enqueue depends on this
* ldlm_reprocess_all. If this moves, revisit that code. -phil */
LDLM_DEBUG(lock, "server-side enqueue handler, sending reply"
"(err=%d, rc=%d)", err, rc);
LDLM_DEBUG(lock, "server-side enqueue handler, sending reply"
"(err=%d, rc=%d)", err, rc);