This is a note to let you know that I've just added the patch titled

    tty: serial: OMAP: Fix oops due to NULL pdata in DT boot

to my tty git tree which can be found at
    git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-next branch.

The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)

The patch will also will be merged in the next major kernel release
during the merge window.

If you have any questions about this process, please let me know.


>From a5f43138da9beddc46b00ec31d167143a7176683 Mon Sep 17 00:00:00 2001
From: "Cousson, Benoit" <[email protected]>
Date: Tue, 28 Feb 2012 18:22:12 +0100
Subject: tty: serial: OMAP: Fix oops due to NULL pdata in DT boot

The following commit: be4b0281956c5cae4f63f31f11d07625a6988766
(tty: serial: OMAP: block idle while the UART is transferring data in PIO mode),
is introducing an oops if OMAP is booted using device tree blob because
the pdata will not be initialized.

Check if pdata is set before de-referencing it.

Signed-off-by: Benoit Cousson <[email protected]>
Reviewed-by: Paul Walmsley <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/tty/serial/omap-serial.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index f809041..0121486 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -159,7 +159,7 @@ static void serial_omap_stop_tx(struct uart_port *port)
                serial_out(up, UART_IER, up->ier);
        }
 
-       if (!up->use_dma && pdata->set_forceidle)
+       if (!up->use_dma && pdata && pdata->set_forceidle)
                pdata->set_forceidle(up->pdev);
 
        pm_runtime_mark_last_busy(&up->pdev->dev);
@@ -298,7 +298,7 @@ static void serial_omap_start_tx(struct uart_port *port)
        if (!up->use_dma) {
                pm_runtime_get_sync(&up->pdev->dev);
                serial_omap_enable_ier_thri(up);
-               if (pdata->set_noidle)
+               if (pdata && pdata->set_noidle)
                        pdata->set_noidle(up->pdev);
                pm_runtime_mark_last_busy(&up->pdev->dev);
                pm_runtime_put_autosuspend(&up->pdev->dev);
@@ -1613,7 +1613,7 @@ static int serial_omap_runtime_resume(struct device *dev)
        struct uart_omap_port *up = dev_get_drvdata(dev);
        struct omap_uart_port_info *pdata = dev->platform_data;
 
-       if (up) {
+       if (up && pdata) {
                if (pdata->get_context_loss_count) {
                        u32 loss_cnt = pdata->get_context_loss_count(dev);
 
-- 
1.7.9


--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to