mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
e4d43c1764
commit
944ea4dd38
2 changed files with 6 additions and 3 deletions
|
@ -608,7 +608,10 @@ static inline int dmaengine_device_control(struct dma_chan *chan,
|
|||
enum dma_ctrl_cmd cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
return chan->device->device_control(chan, cmd, arg);
|
||||
if (chan->device->device_control)
|
||||
return chan->device->device_control(chan, cmd, arg);
|
||||
else
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline int dmaengine_slave_config(struct dma_chan *chan,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue