diff options
author | Stephen Cameron <stephenmcameron@gmail.com> | 2015-01-23 17:44:14 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2015-02-02 12:57:42 -0500 |
commit | 07543e0c05de177f2e9612ae7756e904b329379c (patch) | |
tree | c8ffbbb1b192c4452047999b3175a17673892658 /drivers/scsi/hpsa.c | |
parent | e4aa3e6ae2a82ecfce7eecc6c52dcaba7b9e3f84 (diff) |
hpsa: guard against overflowing raid map array
In the code that translates logical drive LBAs to physical
drive LBAs if we overflow the raid map disk data array we
will get the wrong answers. We do not expect that to happen,
but best to be on the safe side and guard against it anyway.
Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r-- | drivers/scsi/hpsa.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index afd192d2d27d..03fae8af23ec 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -3921,6 +3921,9 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h, | |||
3921 | return IO_ACCEL_INELIGIBLE; | 3921 | return IO_ACCEL_INELIGIBLE; |
3922 | } | 3922 | } |
3923 | 3923 | ||
3924 | if (unlikely(map_index >= RAID_MAP_MAX_ENTRIES)) | ||
3925 | return IO_ACCEL_INELIGIBLE; | ||
3926 | |||
3924 | c->phys_disk = dev->phys_disk[map_index]; | 3927 | c->phys_disk = dev->phys_disk[map_index]; |
3925 | 3928 | ||
3926 | disk_handle = dd[map_index].ioaccel_handle; | 3929 | disk_handle = dd[map_index].ioaccel_handle; |