From: Dan Carpenter Date: Fri, 18 Nov 2016 11:53:39 +0000 (+0300) Subject: scsi: be2iscsi: allocate enough memory in beiscsi_boot_get_sinfo() X-Git-Tag: v4.1.12-98.0.20170517_2143~42^2~49 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=926e5818cd58fa9bb13d7e286574f36a60834afe;p=users%2Fjedix%2Flinux-maple.git scsi: be2iscsi: allocate enough memory in beiscsi_boot_get_sinfo() Orabug: 25655127 We accidentally allocate sizeof(u32) instead of sizeof(struct be_cmd_get_session_resp). Fixes: 50a4b824be9e ("scsi: be2iscsi: Fix to make boot discovery non-blocking") Signed-off-by: Dan Carpenter Reviewed by: Jitendra Bhivare Signed-off-by: Martin K. Petersen Signed-off-by: Jitendra Bhivare Signed-off-by: Ethan Zhao Signed-off-by: Dhaval Giani --- diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index 59fe6d07aadc1..c30ffc564d5aa 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c @@ -1083,7 +1083,7 @@ unsigned int beiscsi_boot_get_sinfo(struct beiscsi_hba *phba) nonemb_cmd = &phba->boot_struct.nonemb_cmd; nonemb_cmd->size = sizeof(*resp); nonemb_cmd->va = pci_alloc_consistent(phba->ctrl.pdev, - sizeof(nonemb_cmd->size), + nonemb_cmd->size, &nonemb_cmd->dma); if (!nonemb_cmd->va) { mutex_unlock(&ctrl->mbox_lock);