]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
hpsa: check for a null phys_disk pointer in ioaccel2
authorDon Brace <don.brace@microsemi.com>
Fri, 6 May 2016 19:15:14 +0000 (12:15 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 22 May 2016 21:50:18 +0000 (14:50 -0700)
 path

An oops can occur when submitting ioaccel2 commands when the phys_disk
pointer is NULL in hpsa_scsi_ioaccel_raid_map.  Happens when there are
configuration changes during I/O operations.

If the phys_disk pointer is NULL, send the command down the RAID path.

Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com>
Reviewed-by: Justin Lindley <justin.lindley@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
drivers/scsi/hpsa.c

index 589b44ea31075f558466ab03a29fe2cb167ba45a..edbecf84d79d547e858bd1d1617e970c82147c55 100644 (file)
@@ -4981,6 +4981,8 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h,
                return IO_ACCEL_INELIGIBLE;
 
        c->phys_disk = dev->phys_disk[map_index];
+       if (!c->phys_disk)
+               return IO_ACCEL_INELIGIBLE;
 
        disk_handle = dd[map_index].ioaccel_handle;
        disk_block = le64_to_cpu(map->disk_starting_blk) +