]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dmatest: fix max channels handling
authorDan Williams <dan.j.williams@intel.com>
Wed, 8 Apr 2009 22:08:23 +0000 (15:08 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 May 2009 23:35:16 +0000 (16:35 -0700)
commit c56c81abe7e684bc6203632d807303eb765690dc upstream.

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 ]

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/dma/dmatest.c

index e190d8b30700c40858fceb83afa05f49d9ce8d2e..7ffc5ac73c2f386cdfe72dec1fe3ed9edd0f874d 100644 (file)
@@ -410,9 +410,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 */
                        }