public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Tobias Klauser <tklauser@distanz.ch>
To: Alan Cox <alan@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-serial@vger.kernel.org, Yuriy Kozlov <ykozlov@ptcusa.com>
Subject: [PATCH] tty: serial: altera_uart: Check for NULL platform_data in probe.
Date: Thu, 29 Mar 2012 09:55:27 +0200	[thread overview]
Message-ID: <1333007727-24045-1-git-send-email-tklauser@distanz.ch> (raw)

From: Yuriy Kozlov <ykozlov@ptcusa.com>

Follow altera_jtag_uart.  This fixes a crash if there is a mistake in the DTS.

Signed-off-by: Yuriy Kozlov <ykozlov@ptcusa.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/tty/serial/altera_uart.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
index e790375..1f03309 100644
--- a/drivers/tty/serial/altera_uart.c
+++ b/drivers/tty/serial/altera_uart.c
@@ -556,7 +556,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
 	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (res_mem)
 		port->mapbase = res_mem->start;
-	else if (platp->mapbase)
+	else if (platp)
 		port->mapbase = platp->mapbase;
 	else
 		return -EINVAL;
@@ -564,7 +564,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
 	res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (res_irq)
 		port->irq = res_irq->start;
-	else if (platp->irq)
+	else if (platp)
 		port->irq = platp->irq;
 
 	/* Check platform data first so we can override device node data */
-- 
1.7.5.4


             reply	other threads:[~2012-03-29  8:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29  7:55 Tobias Klauser [this message]
2012-03-29 16:13 ` [PATCH] tty: serial: altera_uart: Check for NULL platform_data in probe Greg Kroah-Hartman
2012-03-29 19:38   ` Tobias Klauser
2012-03-29 19:47     ` Greg Kroah-Hartman
2012-03-29 20:02       ` Yuriy Kozlov
2012-03-29 21:39         ` Greg Kroah-Hartman
2012-03-30  6:32           ` Tobias Klauser

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=1333007727-24045-1-git-send-email-tklauser@distanz.ch \
    --to=tklauser@distanz.ch \
    --cc=alan@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=ykozlov@ptcusa.com \
    /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