From patchwork Thu May 9 12:50:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16806 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D95B4238F7 for ; Thu, 9 May 2013 12:51:30 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id 15sf3758142vea.9 for ; Thu, 09 May 2013 05:51:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=xWeNrk1XVPhnfvxDvm/0sZseIfuIWlUOpjwsrh4q5iM=; b=b4+26Q3w29dNUW04mzCgBObVXMzazzR/PGqKF3o3i3i/uwsrWWRv9yT9gxNLIHxB7J RlsHA/um24yN/vA+a2ORZNZnMkR5mguv3kE7O0p0kZ5TQ/G30P5h5FtxN6NEZxnM+iIt YPE37oSgaUyQ+FVWvSg7H1DNpsnsw0aMBRhM3L3VSBnijkTGu/BahCA9qwrOxAdh2B/G tyQeKC0ruug3iMTww2m+/wxLpyQ1hKKJ3J7S0yjO6kx74UpGHQDojep2tZxqnYaZF4r9 c70y5jzR0ktB5JbHsGhPwxZn76pmt/M5T5eD8hPxyWoViPBDGF37oCscRceyvRxdiceX NMiA== X-Received: by 10.236.230.72 with SMTP id i68mr5919986yhq.23.1368103867351; Thu, 09 May 2013 05:51:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.42.69 with SMTP id m5ls631681qel.51.gmail; Thu, 09 May 2013 05:51:07 -0700 (PDT) X-Received: by 10.220.176.71 with SMTP id bd7mr7622722vcb.12.1368103867141; Thu, 09 May 2013 05:51:07 -0700 (PDT) Received: from mail-vb0-x236.google.com (mail-vb0-x236.google.com [2607:f8b0:400c:c02::236]) by mx.google.com with ESMTPS id sa4si1437132vdc.49.2013.05.09.05.51.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 May 2013 05:51:07 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::236 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::236; Received: by mail-vb0-f54.google.com with SMTP id f12so2518891vbg.27 for ; Thu, 09 May 2013 05:51:07 -0700 (PDT) X-Received: by 10.221.0.199 with SMTP id nn7mr7811056vcb.14.1368103867048; Thu, 09 May 2013 05:51:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.217.234 with SMTP id pb10csp14597vec; Thu, 9 May 2013 05:51:05 -0700 (PDT) X-Received: by 10.180.38.48 with SMTP id d16mr17392025wik.16.1368103864847; Thu, 09 May 2013 05:51:04 -0700 (PDT) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [2a00:1450:400c:c05::236]) by mx.google.com with ESMTPS id di5si771385wjc.147.2013.05.09.05.51.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 May 2013 05:51:04 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::236 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::236; Received: by mail-wi0-f182.google.com with SMTP id m6so3065435wiv.3 for ; Thu, 09 May 2013 05:51:04 -0700 (PDT) X-Received: by 10.194.240.132 with SMTP id wa4mr17827808wjc.52.1368103864316; Thu, 09 May 2013 05:51:04 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPSA id ek7sm15308122wic.4.2013.05.09.05.51.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 May 2013 05:51:02 -0700 (PDT) From: Lee Jones 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 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> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQnddmSfyqMCJIMkugWrAOj/A/Hq//oZ30VE/sIs34F6nIP0a71ESsWxKYJcHQCJMTop9NxG X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::236 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;