mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-02-04 07:15:01 +00:00
cciss: Make cciss_seq_show handle holes in the h->drv[] array
commit 531c2dc70d339c5dfa8c3eb628c3459dc6f3a075 upstream. It is possible (and expected) for there to be holes in the h->drv[] array, that is, some elements may be NULL pointers. cciss_seq_show needs to be made aware of this possibility to avoid an Oops. To reproduce the Oops which this fixes: 1) Create two "arrays" in the Array Configuratino Utility and several logical drives on each array. 2) cat /proc/driver/cciss/cciss* in an infinite loop 3) delete some of the logical drives in the first "array." Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
77e4ffd96c
commit
b7f7ed5565
@@ -323,6 +323,9 @@ static int cciss_seq_show(struct seq_file *seq, void *v)
|
||||
if (*pos > h->highest_lun)
|
||||
return 0;
|
||||
|
||||
if (drv == NULL) /* it's possible for h->drv[] to have holes. */
|
||||
return 0;
|
||||
|
||||
if (drv->heads == 0)
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user