IMX serial: Check platform data pointer before use
PATCH 1/1 IMX serial: Check platform data pointer before use
pdev->dev.platform_data can be NULL in driver probe function. This is should be checked before any use of imxuart_platform_data structure.
Signed-off-by Yauhen Kharuzhy <[email protected]>
--- drivers/serial/imx.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/serial/imx.c +3 -3
@@ -1279,7 +1279,7 @@ static int serial_imx_probe(struct platform_device *pdev) sport->use_irda =1 ;#endif -if (pdata->init) { +if (pdata && pdata->init) { ret = pdata->init (pdev);if (ret) goto clkput;
@@ -1292,7 +1292,7 @@ static int serial_imx_probe(struct platform_device *pdev)return 0 ; deinit: -if (pdata->exit) +if (pdata && pdata->exit) pdata->exit (pdev); clkput:clk_put (sport->clk);
@@ -1321,7 +1321,7 @@ static int serial_imx_remove(struct platform_device *pdev)clk_disable (sport->clk); -if (pdata->exit) +if (pdata && pdata->exit) pdata->exit (pdev);iounmap (sport->port.membase);
Signature · 1 line
1.6.5.7
PATCH 1/1 IMX serial: Check platform data pointer before use
Quoted 4 lines · Yauhen Kharuzhy
pdev->dev.platform_datacan be NULL in driver probe function. This is should be checked before any use ofimxuart_platform_datastructure.Signed-off-by Yauhen Kharuzhy <[email protected]>
Acked-by Wolfram Sang <[email protected]>
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100116/7ad51732/attachment.sig>
PATCH 1/1 IMX serial: Check platform data pointer before use
In reply to Yauhen KharuzhyHi Yauhen,
Quoted 4 lines · Yauhen Kharuzhy
pdev->dev.platform_datacan be NULL in driver probe function. This is should be checked before any use ofimxuart_platform_datastructure.Signed-off-by Yauhen Kharuzhy <[email protected]>
A similar patch is already in Greg's tty tree.
Quoted 37 lines
--- drivers/serial/imx.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)drivers/serial/imx.c +3
-3@@ -1279,7 +1279,7 @@ static int serial_imx_probe(struct platform_device *pdev) sport->use_irda =1 ;#endif -if (pdata->init) { +if (pdata && pdata->init) { ret = pdata->init (pdev);if (ret) goto clkput;@@ -1292,7 +1292,7 @@ static int serial_imx_probe(struct platform_device *pdev)return 0 ; deinit: -if (pdata->exit) +if (pdata && pdata->exit) pdata->exit (pdev); clkput:clk_put (sport->clk);@@ -1321,7 +1321,7 @@ static int serial_imx_remove(struct platform_device *pdev)clk_disable (sport->clk); -if (pdata->exit) +if (pdata && pdata->exit) pdata->exit (pdev);iounmap (sport->port.membase);Signature · 1 line
1.6.5.7
Signature · 3 lines
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -