Commit fce84664 authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Jim Harris
Browse files

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: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/393912


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatar <shuhei.matsumoto.xt@hitachi.com>
parent fb8acd90
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}