dmatest: Fix NULL pointer dereference on ioat
authorJon Mason <jon.mason@intel.com>
Sun, 11 Nov 2012 23:03:20 +0000 (23:03 +0000)
committerVinod Koul <vinod.koul@intel.com>
Tue, 8 Jan 2013 06:05:05 +0000 (22:05 -0800)
commit944ea4dd38b8575e30a5699633c81945bff1864d
tree7883205efd57c7c1e95ad2cb2bed59bde165ecc8
parente4d43c1764bc3ee1150f24e530db2b5b23e91425
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>
drivers/dma/dmatest.c
include/linux/dmaengine.h