]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00218807 ESAI: fix bootup issue cause by accessing unexist address
authorChen Liangjun <b36089@freescale.com>
Mon, 30 Jul 2012 09:31:32 +0000 (17:31 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:08 +0000 (08:35 +0200)
To support p2p playback, ESAI driver would copy platform data to
esai_asrc struct. The platform data only exist on boards that supports
ESAI. However, for ARM2 board, it supports ESAI but not necessary
get the codec CS42888. Thus the probe() in ESAI driver would also try to
copy the platform data from board init file.

The p2p playback now only support ARD board, so the ESAI probe() for
ARM2 would access unexisted address and cause an kernel dump.

In the patch, check the platform data address before copy.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
sound/soc/imx/imx-cs42888.c

index 5fc128a4aacbe4d6f3cee1c05be75bd774a80b7e..e06b1a7fc314cb7774c1645683d4cba902afda87 100644 (file)
@@ -376,7 +376,9 @@ static int __devinit imx_3stack_cs42888_probe(struct platform_device *pdev)
                imx_3stack_dai[1].codec_name = plat_data->codec_name;
        }
        esai_asrc = kzalloc(sizeof(struct asrc_p2p_params), GFP_KERNEL);
-       memcpy(esai_asrc, plat_data->priv,  sizeof(struct asrc_p2p_params));
+       if (plat_data->priv)
+               memcpy(esai_asrc, plat_data->priv,
+                               sizeof(struct asrc_p2p_params));
        return 0;
 }