mirror of
https://github.com/S3NEO/android_kernel_samsung_msm8226.git
synced 2024-11-07 03:47:13 +00:00
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>
This commit is contained in:
parent
72d4cd9f38
commit
0fc13c8995
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue