dmaengine: pl330: Fix NULL pointer dereference on probe failure
[deliverable/linux.git] / drivers / dma / pl330.c
index 28e3775888a619e86c0345c4c95d9603d4e150f3..4a2caaa0432e0b590a107b5f58f239fc53a71a04 100644 (file)
@@ -2748,8 +2748,10 @@ probe_err3:
                list_del(&pch->chan.device_node);
 
                /* Flush the channel */
-               pl330_control(&pch->chan, DMA_TERMINATE_ALL, 0);
-               pl330_free_chan_resources(&pch->chan);
+               if (pch->thread) {
+                       pl330_control(&pch->chan, DMA_TERMINATE_ALL, 0);
+                       pl330_free_chan_resources(&pch->chan);
+               }
        }
 probe_err2:
        pl330_del(pl330);
This page took 0.027033 seconds and 5 git commands to generate.