linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: pl011: protect attribute read from NULL platform data struct
@ 2013-05-09 12:50 Lee Jones
  2013-05-13 19:09 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2013-05-09 12:50 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: arnd, linus.walleij, srinidhi.kasagar, Lee Jones, Russell King,
	Greg Kroah-Hartman, Jiri Slaby, linux-serial

It's completely feasible that platform data will be empty i.e. when
booting with Device Tree with no device AUXDATA. So we must protect
it's use in these use-cases, or risk a kernel Oops.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: linux-serial@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
*******                                                        *******
If this issue has not already been fixed, this patch should be applied
during the v3.10 -rc:s, as it fixes a serious bug which was introduced
in the merge-window.
*******                                                        *******

 drivers/tty/serial/amba-pl011.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 8ab70a6..e2774f9 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -332,7 +332,7 @@ static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port *
 		dmaengine_slave_config(chan, &rx_conf);
 		uap->dmarx.chan = chan;
 
-		if (plat->dma_rx_poll_enable) {
+		if (plat && plat->dma_rx_poll_enable) {
 			/* Set poll rate if specified. */
 			if (plat->dma_rx_poll_rate) {
 				uap->dmarx.auto_poll_rate = false;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] serial: pl011: protect attribute read from NULL platform data struct
  2013-05-09 12:50 [PATCH] serial: pl011: protect attribute read from NULL platform data struct Lee Jones
@ 2013-05-13 19:09 ` Linus Walleij
  2013-05-15  9:23   ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2013-05-13 19:09 UTC (permalink / raw)
  To: Lee Jones, Greg KH
  Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Arnd Bergmann, Linus WALLEIJ,
	Srinidhi KASAGAR, Russell King, Jiri Slaby,
	linux-serial@vger.kernel.org

On Thu, May 9, 2013 at 2:50 PM, Lee Jones <lee.jones@linaro.org> wrote:

> It's completely feasible that platform data will be empty i.e. when
> booting with Device Tree with no device AUXDATA. So we must protect
> it's use in these use-cases, or risk a kernel Oops.
>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jslaby@suse.cz>
> Cc: linux-serial@vger.kernel.org
> Cc: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
> *******                                                        *******
> If this issue has not already been fixed, this patch should be applied
> during the v3.10 -rc:s, as it fixes a serious bug which was introduced
> in the merge-window.
> *******                                                        *******

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

You should probably put Greg on To: so that he picks this up for
the -rc:s ASAP.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] serial: pl011: protect attribute read from NULL platform data struct
  2013-05-13 19:09 ` Linus Walleij
@ 2013-05-15  9:23   ` Lee Jones
  0 siblings, 0 replies; 3+ messages in thread
From: Lee Jones @ 2013-05-15  9:23 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Greg KH, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Arnd Bergmann, Linus WALLEIJ,
	Srinidhi KASAGAR, Russell King, Jiri Slaby,
	linux-serial@vger.kernel.org

On Mon, 13 May 2013, Linus Walleij wrote:

> On Thu, May 9, 2013 at 2:50 PM, Lee Jones <lee.jones@linaro.org> wrote:
> 
> > It's completely feasible that platform data will be empty i.e. when
> > booting with Device Tree with no device AUXDATA. So we must protect
> > it's use in these use-cases, or risk a kernel Oops.
> >
> > Cc: Russell King <linux@arm.linux.org.uk>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Jiri Slaby <jslaby@suse.cz>
> > Cc: linux-serial@vger.kernel.org
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > ---
> > *******                                                        *******
> > If this issue has not already been fixed, this patch should be applied
> > during the v3.10 -rc:s, as it fixes a serious bug which was introduced
> > in the merge-window.
> > *******                                                        *******
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> 
> You should probably put Greg on To: so that he picks this up for
> the -rc:s ASAP.

I spoke with Greg yesterday. He's catching up on mail.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-15  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-09 12:50 [PATCH] serial: pl011: protect attribute read from NULL platform data struct Lee Jones
2013-05-13 19:09 ` Linus Walleij
2013-05-15  9:23   ` Lee Jones

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).