serial: sccnxp: Fix possible crash if no platform data supplied
authorAlexander Shiyan <shc_work@mail.ru>
Thu, 17 Jan 2013 14:34:45 +0000 (18:34 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jan 2013 01:31:24 +0000 (17:31 -0800)
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 <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sccnxp.c

index c864353352c5bf9a4f96985428d9ead6764c1a62..c5f0e964ec058bd85de55b39fdccfc0c03271186 100644 (file)
@@ -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;
        }