From: Alexander Shiyan Date: Thu, 17 Jan 2013 14:34:45 +0000 (+0400) Subject: serial: sccnxp: Fix possible crash if no platform data supplied X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b786337d8c2867962348711e8d1211b292b6e3c5;p=linux-beck.git serial: sccnxp: Fix possible crash if no platform data supplied This patch fix possible kernel crash if no platform data supplied. We should not use platform data in this case, instead we will use default values from private driver structure. Signed-off-by: Alexander Shiyan Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c index c864353352c5..c5f0e964ec05 100644 --- a/drivers/tty/serial/sccnxp.c +++ b/drivers/tty/serial/sccnxp.c @@ -891,9 +891,9 @@ static int sccnxp_probe(struct platform_device *pdev) } else memcpy(&s->pdata, pdata, sizeof(struct sccnxp_pdata)); - if (pdata->poll_time_us) { + if (s->pdata.poll_time_us) { dev_info(&pdev->dev, "Using poll mode, resolution %u usecs\n", - pdata->poll_time_us); + s->pdata.poll_time_us); s->poll = 1; }