[PATCH 4.1 067/123] mmc: sdhci-pxav3: fix platform_data is not initialized

From: Greg Kroah-Hartman
Date: Sat Aug 08 2015 - 18:35:11 EST

4.1-stable review patch. If anyone has any objections, please let me know.


From: Jingju Hou <houjingj@xxxxxxxxxxx>

commit 9cd76049f0d90ae241f5ad80e311489824527000 upstream.

pdev->dev.platform_data is not initialized if match is true in function
sdhci_pxav3_probe. Just local variable pdata is assigned the return value
from function pxav3_get_mmc_pdata().

static int sdhci_pxav3_probe(struct platform_device *pdev) {

struct sdhci_pxa_platdata *pdata = pdev->dev.platform_data;
if (match) {
ret = mmc_of_parse(host->mmc);
if (ret)
goto err_of_parse;
pdata = pxav3_get_mmc_pdata(dev);

Signed-off-by: Jingju Hou <houjingj@xxxxxxxxxxx>
Fixes: b650352dd3df("mmc: sdhci-pxa: Add device tree support")
Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

drivers/mmc/host/sdhci-pxav3.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -411,6 +411,7 @@ static int sdhci_pxav3_probe(struct plat
goto err_of_parse;
pdata = pxav3_get_mmc_pdata(dev);
+ pdev->dev.platform_data = pdata;
} else if (pdata) {
/* on-chip device */
if (pdata->flags & PXA_FLAG_CARD_PERMANENT)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/