linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] scsi: be2iscsi: allocate enough memory in beiscsi_boot_get_sinfo()
@ 2016-11-18 11:53 Dan Carpenter
  2016-11-21  4:02 ` Jitendra Bhivare
  2016-11-22  3:33 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-11-18 11:53 UTC (permalink / raw)
  To: Subbu Seetharaman, Jitendra Bhivare
  Cc: Ketan Mukadam, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, kernel-janitors

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 <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index aebc4dd..ac05317b 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);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [patch] scsi: be2iscsi: allocate enough memory in beiscsi_boot_get_sinfo()
  2016-11-18 11:53 [patch] scsi: be2iscsi: allocate enough memory in beiscsi_boot_get_sinfo() Dan Carpenter
@ 2016-11-21  4:02 ` Jitendra Bhivare
  2016-11-22  3:33 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Jitendra Bhivare @ 2016-11-21  4:02 UTC (permalink / raw)
  To: Dan Carpenter, Subramanian Seetharaman
  Cc: Ketan Mukadam, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, kernel-janitors

> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Friday, November 18, 2016 5:24 PM
> To: Subbu Seetharaman; Jitendra Bhivare
> Cc: Ketan Mukadam; James E.J. Bottomley; Martin K. Petersen; linux-
> scsi@vger.kernel.org; kernel-janitors@vger.kernel.org
> Subject: [patch] scsi: be2iscsi: allocate enough memory in
> beiscsi_boot_get_sinfo()
>
> 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 <dan.carpenter@oracle.com>
>
> diff --git a/drivers/scsi/be2iscsi/be_mgmt.c
b/drivers/scsi/be2iscsi/be_mgmt.c
> index aebc4dd..ac05317b 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);

Reviewed by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>

Thanks,

JB

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] scsi: be2iscsi: allocate enough memory in beiscsi_boot_get_sinfo()
  2016-11-18 11:53 [patch] scsi: be2iscsi: allocate enough memory in beiscsi_boot_get_sinfo() Dan Carpenter
  2016-11-21  4:02 ` Jitendra Bhivare
@ 2016-11-22  3:33 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2016-11-22  3:33 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Subbu Seetharaman, Jitendra Bhivare, Ketan Mukadam,
	James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	kernel-janitors

>>>>> "Dan" == Dan Carpenter <dan.carpenter@oracle.com> writes:

Dan> We accidentally allocate sizeof(u32) instead of sizeof(struct
Dan> be_cmd_get_session_resp).

Applied to 4.9/scsi-fixes.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-22  3:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-18 11:53 [patch] scsi: be2iscsi: allocate enough memory in beiscsi_boot_get_sinfo() Dan Carpenter
2016-11-21  4:02 ` Jitendra Bhivare
2016-11-22  3:33 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).