From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: [PATCH] serial: pl011: protect attribute read from NULL platform data struct Date: Thu, 9 May 2013 13:50:55 +0100 Message-ID: <1368103855-28363-1-git-send-email-lee.jones@linaro.org> Return-path: Received: from mail-we0-f172.google.com ([74.125.82.172]:37591 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753188Ab3EIMvG (ORCPT ); Thu, 9 May 2013 08:51:06 -0400 Received: by mail-we0-f172.google.com with SMTP id w60so2864089wes.31 for ; Thu, 09 May 2013 05:51:04 -0700 (PDT) Sender: linux-serial-owner@vger.kernel.org List-Id: linux-serial@vger.kernel.org To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Lee Jones , Russell King , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org 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 Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Cc: Arnd Bergmann Signed-off-by: Lee Jones --- ******* ******* 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