diff mbox series

scsi: hpsa: fix allocation size for scsi_host_alloc()

Message ID 20230118031255.GE15213@altlinux.org
State Superseded
Headers show
Series scsi: hpsa: fix allocation size for scsi_host_alloc() | expand

Commit Message

Alexey V. Vissarionov Jan. 18, 2023, 3:12 a.m. UTC
On 2023-01-17 13:23:19 -0800, Bart Van Assche wrote:

 > My understanding is that you used an incorrect commit hash.
 > Hence, it is up to you to fix the commit hash.

ACK. Resending:


The 'h' is a pointer to struct ctlr_info, so it's just 4 or 8
bytes, while the structure itself is much bigger.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: edd163687ea5 ("[SCSI] hpsa: combine hpsa_scsi_detect and hpsa_register_scsi")
Signed-off-by: Alexey V. Vissarionov <gremlin@altlinux.org>

Comments

Martin K. Petersen Jan. 19, 2023, 12:06 a.m. UTC | #1
Alexey,

Next time please use -v2 instead of replying when you post a version 2
of a patch.

> On 2023-01-17 13:23:19 -0800, Bart Van Assche wrote:
>
>  > My understanding is that you used an incorrect commit hash.
>  > Hence, it is up to you to fix the commit hash.
>
> ACK. Resending:

Comments such as this ACK must go below a '---' separator to avoid
ending up in the commit log.

And finally, the updated commit hash now no longer matches the commit
description:

> Fixes: edd163687ea5 ("[SCSI] hpsa: combine hpsa_scsi_detect and hpsa_register_scsi")

$ git log --oneline edd163687ea5 -1
edd163687ea5 [SCSI] hpsa: add driver for HP Smart Array controllers.

I fixed these up and applied to 6.2/scsi-fixes, thanks!
Martin K. Petersen Jan. 19, 2023, 12:21 a.m. UTC | #2
On Wed, 18 Jan 2023 06:12:55 +0300, Alexey V. Vissarionov wrote:

> On 2023-01-17 13:23:19 -0800, Bart Van Assche wrote:
> 
>  > My understanding is that you used an incorrect commit hash.
>  > Hence, it is up to you to fix the commit hash.
> 
> ACK. Resending:
> 
> [...]

Applied to 6.2/scsi-fixes, thanks!

[1/1] scsi: hpsa: fix allocation size for scsi_host_alloc()
      https://git.kernel.org/mkp/scsi/c/bbbd25499100
diff mbox series

Patch

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 4dbf51e2623ad543..f6da34850af9dd46 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -5850,7 +5850,7 @@  static int hpsa_scsi_host_alloc(struct ctlr_info *h)
 {
 	struct Scsi_Host *sh;
 
-	sh = scsi_host_alloc(&hpsa_driver_template, sizeof(h));
+	sh = scsi_host_alloc(&hpsa_driver_template, sizeof(struct ctlr_info));
 	if (sh == NULL) {
 		dev_err(&h->pdev->dev, "scsi_host_alloc failed\n");
 		return -ENOMEM;