dw-mmc: prevent the Null pointer dereference for dma_ops
Subsystems (2)
Jaehoon Chung
maintainerPATCH 1/1 dw-mmc: prevent the Null pointer dereference for dma_ops
Now, dma_ops is assumed that use the IDMAC. But if dma_ops is assigned the pdata->dma_ops, We didn't ensure that callback function is defined.
If anything of callback didn't define, then should be run the PIO mode.
--- drivers/mmc/host/dw_mmc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/mmc/host/dw_mmc.c +2 -1
@@ -1881,7 +1881,8 @@ static void dw_mci_init_dma(struct dw_mci *host)if (!host->dma_ops) goto no_dma; -if (host->dma_ops->init) { +if (host->dma_ops->init && host->dma_ops->start && + host->dma_ops->stop && host->dma_ops->cleanup) {if (host->dma_ops->init (host)) {dev_err (&host->dev,"%s: Unable to initialize " "DMA Controller.\n" , __func__);
Signature · 1 line
1.7.4.1
Quoted 11 lines · Jaehoon Chung
Now,
dma_opsis assumed that use the IDMAC. But ifdma_opsis assigned thepdata->dma_ops, We didn't ensure that callback function is defined.If anything of callback didn't define, then should be run the PIO mode.
Signed-off-by Jaehoon Chung <[email protected]>Signed-off-by Kyungmin Park <[email protected]>---
drivers/mmc/host/dw_mmc.c | 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)
This looks ok.
Hi,
Quoted 13 lines · Will Newton
Quoted 11 lines · Jaehoon Chung
Now,
dma_opsis assumed that use the IDMAC. But ifdma_opsis assigned thepdata->dma_ops, We didn't ensure that callback function is defined.If anything of callback didn't define, then should be run the PIO mode.
Signed-off-by Jaehoon Chung <[email protected]>Signed-off-by Kyungmin Park <[email protected]>---
drivers/mmc/host/dw_mmc.c | 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)
Quoted 3 lines
This looks ok.
Acked-by Will Newton <[email protected]>
Thanks, pushed to mmc-next for 3.5.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child