mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
scsi: hpsa: Fix allocation size for Scsi_Host private data
[ Upstream commit504e2bed5d
] 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:bbbd254991
("scsi: hpsa: Fix allocation size for scsi_host_alloc()") Signed-off-by: Yuri Karpov <YKarpov@ispras.ru> Link: https://lore.kernel.org/r/20240312170447.743709-1-YKarpov@ispras.ru Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2d8f31aa03
commit
9fc44d44b3
@ -5771,7 +5771,7 @@ static int hpsa_scsi_host_alloc(struct ctlr_info *h)
|
||||
{
|
||||
struct Scsi_Host *sh;
|
||||
|
||||
sh = scsi_host_alloc(&hpsa_driver_template, sizeof(struct ctlr_info));
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user