From: Zachary Amsden Date: Wed, 9 Nov 2005 12:24:20 +0000 (+0100) Subject: [BLOCK] elevator init fixes #2 X-Git-Tag: v2.6.15-rc2~231 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cff3ba2204a0797b05150a4b2b7f40a55023d952;p=linux-2.6 [BLOCK] elevator init fixes #2 In addition to the first patch, which is probably goodness, I found the cause of my panic - applying this patch fixes it and now I am booting. If the chosen_elevator[] is not found, fall back to noop. Signed-off-by: Andrew Morton Signed-off-by: Jens Axboe --- diff --git a/block/elevator.c b/block/elevator.c index 23cfbe528b..e58928e809 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -155,9 +155,10 @@ static void elevator_setup_default(void) /* * If the given scheduler is not available, fall back to no-op. */ - if (!(e = elevator_find(chosen_elevator))) + if ((e = elevator_find(chosen_elevator))) + elevator_put(e); + else strcpy(chosen_elevator, "noop"); - elevator_put(e); } static int __init elevator_setup(char *str)