Have the caller decide whether to report BUG() when zone is incorrect raid0.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Signed-off-by: razb <raziebe@xxxxxxxxx> --- diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 851e631..8870acc 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -377,7 +377,7 @@ static struct strip_zone *find_zone(struct raid0_private_data *conf, *sectorp = sector - z[i-1].zone_end; return z + i; } - BUG(); + return NULL; } /* @@ -481,6 +481,8 @@ static int raid0_make_request(struct request_queue *q, struct bio *bio) sector_offset = bio->bi_sector; zone = find_zone(mddev->private, §or_offset); + if (!zone) + BUG(); tmp_dev = map_sector(mddev, zone, bio->bi_sector, §or_offset); bio->bi_bdev = tmp_dev->bdev; -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html