dmatest: fix max channels handling
authorDan Williams <dan.j.williams@intel.com>
Wed, 8 Apr 2009 22:08:23 +0000 (15:08 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 8 Apr 2009 22:08:23 +0000 (15:08 -0700)
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: <stable@kernel.org>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/dmatest.c

index a27c0fb1bc11f17b6b8c56bdc383aee5a710b051..fb7da5141e96b2052fae826f816909c2598035d9 100644 (file)
@@ -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 */
                        }