diff mbox series

scsi: smartpqi: Fix an error code in pqi_get_raid_map()

Message ID 20210810084613.GB23810@kili (mailing list archive)
State Accepted
Headers show
Series scsi: smartpqi: Fix an error code in pqi_get_raid_map() | expand

Commit Message

Dan Carpenter Aug. 10, 2021, 8:46 a.m. UTC
Return -EINVAL on failure instead of success.

Fixes: a91aaae0243b ("scsi: smartpqi: allow for larger raid maps")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Martin K. Petersen Aug. 16, 2021, 5:21 p.m. UTC | #1
Dan,

> Return -EINVAL on failure instead of success.

Applied to 5.15/scsi-staging, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index c1f0f8da9fe2..7ccf8e704486 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -1322,6 +1322,7 @@  static int pqi_get_raid_map(struct pqi_ctrl_info *ctrl_info,
 				"requested %u bytes, received %u bytes\n",
 				raid_map_size,
 				get_unaligned_le32(&raid_map->structure_size));
+			rc = -EINVAL;
 			goto error;
 		}
 	}