Explorar o código

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: <stable@kernel.org>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dan Williams %!s(int64=16) %!d(string=hai) anos
pai
achega
c56c81abe7
Modificáronse 1 ficheiros con 1 adicións e 3 borrados
  1. 1 3
      drivers/dma/dmatest.c

+ 1 - 3
drivers/dma/dmatest.c

@@ -531,9 +531,7 @@ static int __init dmatest_init(void)
 		chan = dma_request_channel(mask, filter, NULL);
 		chan = dma_request_channel(mask, filter, NULL);
 		if (chan) {
 		if (chan) {
 			err = dmatest_add_channel(chan);
 			err = dmatest_add_channel(chan);
-			if (err == 0)
-				continue;
-			else {
+			if (err) {
 				dma_release_channel(chan);
 				dma_release_channel(chan);
 				break; /* add_channel failed, punt */
 				break; /* add_channel failed, punt */
 			}
 			}