Message ID | 20161021105757.22712-1-jh80.chung@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 2016/10/21 18:57, Jaehoon Chung wrote: > platform_get_resource can be returned the NULL pointer. > Then regs->start should be referred to NULL Pointer. > devm_ioremap_resource() checks whether res is NULL or not. > > Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> > --- > drivers/mmc/host/dw_mmc-pltfm.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > Looks good, Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> > diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c > index b486fef..1236d49b 100644 > --- a/drivers/mmc/host/dw_mmc-pltfm.c > +++ b/drivers/mmc/host/dw_mmc-pltfm.c > @@ -47,12 +47,13 @@ int dw_mci_pltfm_register(struct platform_device *pdev, > host->pdata = pdev->dev.platform_data; > > regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - /* Get registers' physical base address */ > - host->phy_regs = regs->start; > host->regs = devm_ioremap_resource(&pdev->dev, regs); > if (IS_ERR(host->regs)) > return PTR_ERR(host->regs); > > + /* Get registers' physical base address */ > + host->phy_regs = regs->start; > + > platform_set_drvdata(pdev, host); > return dw_mci_probe(host); > } >
On 21 October 2016 at 12:57, Jaehoon Chung <jh80.chung@samsung.com> wrote: > platform_get_resource can be returned the NULL pointer. > Then regs->start should be referred to NULL Pointer. > devm_ioremap_resource() checks whether res is NULL or not. > > Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Thanks, applied for fixes abd I also added a stable tag. Kind regards Uffe > --- > drivers/mmc/host/dw_mmc-pltfm.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c > index b486fef..1236d49b 100644 > --- a/drivers/mmc/host/dw_mmc-pltfm.c > +++ b/drivers/mmc/host/dw_mmc-pltfm.c > @@ -47,12 +47,13 @@ int dw_mci_pltfm_register(struct platform_device *pdev, > host->pdata = pdev->dev.platform_data; > > regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - /* Get registers' physical base address */ > - host->phy_regs = regs->start; > host->regs = devm_ioremap_resource(&pdev->dev, regs); > if (IS_ERR(host->regs)) > return PTR_ERR(host->regs); > > + /* Get registers' physical base address */ > + host->phy_regs = regs->start; > + > platform_set_drvdata(pdev, host); > return dw_mci_probe(host); > } > -- > 2.10.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c index b486fef..1236d49b 100644 --- a/drivers/mmc/host/dw_mmc-pltfm.c +++ b/drivers/mmc/host/dw_mmc-pltfm.c @@ -47,12 +47,13 @@ int dw_mci_pltfm_register(struct platform_device *pdev, host->pdata = pdev->dev.platform_data; regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - /* Get registers' physical base address */ - host->phy_regs = regs->start; host->regs = devm_ioremap_resource(&pdev->dev, regs); if (IS_ERR(host->regs)) return PTR_ERR(host->regs); + /* Get registers' physical base address */ + host->phy_regs = regs->start; + platform_set_drvdata(pdev, host); return dw_mci_probe(host); }
platform_get_resource can be returned the NULL pointer. Then regs->start should be referred to NULL Pointer. devm_ioremap_resource() checks whether res is NULL or not. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> --- drivers/mmc/host/dw_mmc-pltfm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)