From: Jitendra Bhivare Date: Fri, 26 Aug 2016 09:39:08 +0000 (+0530) Subject: scsi: be2iscsi: Add missing unlock for mbox_lock X-Git-Tag: v5.15~12656^2~104 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=658f18d1b82b9f9d89f7c74cd2bcbc9b33a74870;p=platform%2Fkernel%2Flinux-starfive.git scsi: be2iscsi: Add missing unlock for mbox_lock Julia pointed out beiscsi_boot_get_sinfo does not unlock mbox_lock on nonemb_cmd memory allocation failure. Signed-off-by: Jitendra Bhivare Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index b9ff939..aebc4dd 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c @@ -1085,8 +1085,10 @@ unsigned int beiscsi_boot_get_sinfo(struct beiscsi_hba *phba) nonemb_cmd->va = pci_alloc_consistent(phba->ctrl.pdev, sizeof(nonemb_cmd->size), &nonemb_cmd->dma); - if (!nonemb_cmd->va) + if (!nonemb_cmd->va) { + mutex_unlock(&ctrl->mbox_lock); return 0; + } req = nonemb_cmd->va; memset(req, 0, sizeof(*req));