Commit b786337d authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Greg Kroah-Hartman

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: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7d9f49af
...@@ -891,9 +891,9 @@ static int sccnxp_probe(struct platform_device *pdev) ...@@ -891,9 +891,9 @@ static int sccnxp_probe(struct platform_device *pdev)
} else } else
memcpy(&s->pdata, pdata, sizeof(struct sccnxp_pdata)); 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", dev_info(&pdev->dev, "Using poll mode, resolution %u usecs\n",
pdata->poll_time_us); s->pdata.poll_time_us);
s->poll = 1; s->poll = 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment