Skip to content

Commit

Permalink
serial: sccnxp: Fix possible crash if no platform data supplied
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Shiyan authored and Greg Kroah-Hartman committed Jan 18, 2013
1 parent 7d9f49a commit b786337
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/tty/serial/sccnxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b786337

Please sign in to comment.