Skip to content

Commit 504e2be

Browse files
Yuri Karpovmartinkpetersen
authored andcommitted
scsi: hpsa: Fix allocation size for Scsi_Host private data
struct Scsi_Host private data contains pointer to struct ctlr_info. Restore allocation of only 8 bytes to store pointer in struct Scsi_Host private data area. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: bbbd254 ("scsi: hpsa: Fix allocation size for scsi_host_alloc()") Signed-off-by: Yuri Karpov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 9cf0c12 commit 504e2be

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(struct ctlr_info));
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)