summaryrefslogtreecommitdiffstats
path: root/drivers/block/raid0.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/raid0.c')
-rw-r--r--drivers/block/raid0.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/block/raid0.c b/drivers/block/raid0.c
index 2e95d34f8..37b2035cd 100644
--- a/drivers/block/raid0.c
+++ b/drivers/block/raid0.c
@@ -182,6 +182,12 @@ static int raid0_map (struct md_dev *mddev, kdev_t *rdev,
block=*rsector >> 1;
hash=data->hash_table+(block/data->smallest->size);
+ if (hash - data->hash_table > data->nr_zones)
+ {
+ printk(KERN_DEBUG "raid0_map: invalid block %ul\n", block);
+ return -1;
+ }
+
/* Sanity check */
if ((chunk_size*2)<(*rsector % (chunk_size*2))+size)
{