From: Dan Williams Date: Wed, 8 Apr 2009 22:08:23 +0000 (-0700) Subject: dmatest: fix max channels handling X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c56c81abe7e684bc6203632d807303eb765690dc;p=linux-beck.git dmatest: fix max channels handling The check for reaching max_channels is short circuited by 'continuing' after successfully adding a channel. [ Impact: make the 'max_channels' module parameter actually have an effect ] Cc: Reported-by: Dan Carpenter Signed-off-by: Dan Williams --- diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index a27c0fb1bc11..fb7da5141e96 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -531,9 +531,7 @@ static int __init dmatest_init(void) chan = dma_request_channel(mask, filter, NULL); if (chan) { err = dmatest_add_channel(chan); - if (err == 0) - continue; - else { + if (err) { dma_release_channel(chan); break; /* add_channel failed, punt */ }