Skip to content

Commit

Permalink
scsi: smartpqi: Fix an error code in pqi_get_raid_map()
Browse files Browse the repository at this point in the history
[ Upstream commit d1f6581 ]

Return -EINVAL on failure instead of success.

Link: https://lore.kernel.org/r/20210810084613.GB23810@kili
Fixes: a91aaae ("scsi: smartpqi: allow for larger raid maps")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dan Carpenter authored and gregkh committed Sep 18, 2021
1 parent f989596 commit 059a125
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/scsi/smartpqi/smartpqi_init.c
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 059a125

Please sign in to comment.