diff options
author | Jon Mason <jon.mason@intel.com> | 2012-11-11 18:03:20 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-01-08 01:05:05 -0500 |
commit | 944ea4dd38b8575e30a5699633c81945bff1864d (patch) | |
tree | 7883205efd57c7c1e95ad2cb2bed59bde165ecc8 /drivers/dma | |
parent | e4d43c1764bc3ee1150f24e530db2b5b23e91425 (diff) |
dmatest: Fix NULL pointer dereference on ioat
device_control is an optional and not implemented in all DMA drivers.
Any calls to these will result in a NULL pointer dereference. dmatest
makes two of these calls when completing the kernel thread and removing
the module. These are corrected by calling the dmaengine_device_control
wrapper and checking for a non-existant device_control function pointer
there.
Signed-off-by: Jon Mason <jon.mason@intel.com>
CC: Vinod Koul <vinod.koul@intel.com>
CC: Dan Williams <djbw@fb.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/dmatest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 3a8047b1f108..99a75e5d66be 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c | |||
@@ -536,7 +536,7 @@ err_srcs: | |||
536 | thread_name, total_tests, failed_tests, ret); | 536 | thread_name, total_tests, failed_tests, ret); |
537 | 537 | ||
538 | /* terminate all transfers on specified channels */ | 538 | /* terminate all transfers on specified channels */ |
539 | chan->device->device_control(chan, DMA_TERMINATE_ALL, 0); | 539 | dmaengine_terminate_all(chan); |
540 | if (iterations > 0) | 540 | if (iterations > 0) |
541 | while (!kthread_should_stop()) { | 541 | while (!kthread_should_stop()) { |
542 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit); | 542 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit); |
@@ -561,7 +561,7 @@ static void dmatest_cleanup_channel(struct dmatest_chan *dtc) | |||
561 | } | 561 | } |
562 | 562 | ||
563 | /* terminate all transfers on specified channels */ | 563 | /* terminate all transfers on specified channels */ |
564 | dtc->chan->device->device_control(dtc->chan, DMA_TERMINATE_ALL, 0); | 564 | dmaengine_terminate_all(dtc->chan); |
565 | 565 | ||
566 | kfree(dtc); | 566 | kfree(dtc); |
567 | } | 567 | } |