summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-12-17 09:01:37 +0100
committerJens Axboe <jaxboe@fusionio.com>2010-12-17 09:01:37 +0100
commit0fc13c8995cd96f4123de400c71c223d80400ed9 (patch)
tree3cbd89861a75d494a104db7d8d129eecfb086782
parentblock: max hardware sectors limit wrapper (diff)
downloadlinux-0fc13c8995cd96f4123de400c71c223d80400ed9.tar.xz
linux-0fc13c8995cd96f4123de400c71c223d80400ed9.zip
cciss: fix cciss_revalidate panic
If you delete a logical drive, and then run BLKRRPART (e.g. via fdisk) on a logical drive which is "after" the deleted logical drive in the h->drv[] array, then cciss_revalidate panics because it will access the null pointer h->drv[x] when x hits the deleted drive. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Cc: stable@kernel.org Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to '')
-rw-r--r--drivers/block/cciss.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index f291587d753e..233e06c29ff4 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -2834,6 +2834,8 @@ static int cciss_revalidate(struct gendisk *disk)
InquiryData_struct *inq_buff = NULL;
for (logvol = 0; logvol < CISS_MAX_LUN; logvol++) {
+ if (!h->drv[logvol])
+ continue
if (memcmp(h->drv[logvol]->LunID, drv->LunID,
sizeof(drv->LunID)) == 0) {
FOUND = 1;