Skip to content

Commit bbbd254

Browse files
Alexey V. Vissarionovmartinkpetersen
Alexey V. Vissarionov
authored andcommitted
scsi: hpsa: Fix allocation size for scsi_host_alloc()
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: edd1636 ("hpsa: add driver for HP Smart Array controllers.") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexey V. Vissarionov <[email protected]> Acked-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 84ed64b commit bbbd254

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/hpsa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5850,7 +5850,7 @@ static int hpsa_scsi_host_alloc(struct ctlr_info *h)
58505850
{
58515851
struct Scsi_Host *sh;
58525852

5853-
sh = scsi_host_alloc(&hpsa_driver_template, sizeof(h));
5853+
sh = scsi_host_alloc(&hpsa_driver_template, sizeof(struct ctlr_info));
58545854
if (sh == NULL) {
58555855
dev_err(&h->pdev->dev, "scsi_host_alloc failed\n");
58565856
return -ENOMEM;

0 commit comments

Comments
 (0)