scsi/lun: fix segfault on sending mgmt task to inexistent lun

spdk_scsi_lun_complete_mgmt_task can't be called with
lun == NULL, as it deliberately dereferences it.

Change-Id: Idf9b100b66cdc7fdfe2011fb7f9b2477651f1e8c
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/393912
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Dariusz Stojaczyk 2018-01-08 12:44:48 +01:00 committed by Jim Harris
parent fb8acd90aa
commit fce8466477

View File

@ -106,7 +106,7 @@ spdk_scsi_lun_task_mgmt_execute(struct spdk_scsi_task *task,
if (!task->lun) {
/* LUN does not exist */
task->response = SPDK_SCSI_TASK_MGMT_RESP_INVALID_LUN;
spdk_scsi_lun_complete_mgmt_task(NULL, task);
task->cpl_fn(task);
return -1;
}