From: Alexander Shiyan <shc_work@mail.ru>
To: linux-serial@vger.kernel.org
Cc: Alan Cox <alan@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dan Carpenter <dan.carpenter@oracle.com>,
Alexander Shiyan <shc_work@mail.ru>
Subject: [PATCH] serial: sccnxp: Fix possible crash if no platform data supplied
Date: Thu, 17 Jan 2013 18:34:45 +0400 [thread overview]
Message-ID: <1358433285-18790-1-git-send-email-shc_work@mail.ru> (raw)
In-Reply-To: <20130117065938.GF16282@mwanda>
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>
---
drivers/tty/serial/sccnxp.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 0c86a0b..3fd83e3 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -897,9 +897,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;
}
--
1.7.8.6
prev parent reply other threads:[~2013-01-17 15:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-17 6:59 [tty:tty-next 42/62] drivers/tty/serial/sccnxp.c:894 sccnxp_probe() error: we previously assumed 'pdata' could be null (see line 887) Dan Carpenter
2013-01-17 7:11 ` Alexander Shiyan
2013-01-17 14:34 ` Alexander Shiyan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1358433285-18790-1-git-send-email-shc_work@mail.ru \
--to=shc_work@mail.ru \
--cc=alan@linux.intel.com \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).