dmaengine: rcar-dmac: initialize all data before registering IRQ handler
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 21 Aug 2017 06:31:57 +0000 (06:31 +0000)
committerVinod Koul <vinod.koul@intel.com>
Fri, 25 Aug 2017 06:57:07 +0000 (12:27 +0530)
commit5e857047ba1e748002088bf44b6b0873664d9567
treeef8928af99dc4d0a3a0e4637ab0369e5e76b743e
parent87c56dcba4573441b5cc4b42ecbb35188fee8f04
dmaengine: rcar-dmac: initialize all data before registering IRQ handler

Anton Volkov noticed that engine->dev is NULL before
of_dma_controller_register() in probe.
Thus there might be a NULL pointer dereference in
rcar_dmac_chan_start_xfer while accessing chan->chan.device->dev which
is equal to (&dmac->engine)->dev.
On same reason, same and similar things will happen if we didn't
initialize all necessary data before calling register irq function.
To be more safety code, this patch initialize all necessary data
before calling register irq function.

Reported-by: Anton Volkov <avolkov@ispras.ru>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/sh/rcar-dmac.c