From patchwork Wed Aug 21 11:47:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 19374 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9B05E23981 for ; Wed, 21 Aug 2013 11:47:26 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id h10sf277302vbh.9 for ; Wed, 21 Aug 2013 04:47:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=cFJrjCMBFmHAPkUdEoGyu+eGqU5DoFgAJ8B1fZuPhss=; b=o7Mzj2YSkTgGR9Lz13CuFdsQTfL9VVRUYZxFvSH86gpM0vD2r+dojtXlxq58Ym5s86 FmUB3KfZlAA6bRIJNDHrYNnCQR5ad/WXYzaYodVG/hGUX7LJM2M22V+BowSO+NURFDgG AHs3Nzjn31KvK2LtuzPAazIXkWBdNxKuzOQcvbZK/TVZKAMEXwlyvMBNeV8avrcYW1WJ p04NGZLzfqYedVlXD/N4YVvpgH2BXb7cqiGr9TeH/QvHHV/A+bFsuiN0jzV98mdo9Wik TaCvqZn+O9s7EuDR1oU7/5oxzPk7czFU9JKFdv1a8Wr672kMVjs0VoH54JWdRNChxYLf k3pQ== X-Received: by 10.236.222.228 with SMTP id t94mr2577803yhp.18.1377085645861; Wed, 21 Aug 2013 04:47:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.8 with SMTP id g8ls585510qeg.67.gmail; Wed, 21 Aug 2013 04:47:25 -0700 (PDT) X-Received: by 10.52.244.78 with SMTP id xe14mr1254712vdc.30.1377085645752; Wed, 21 Aug 2013 04:47:25 -0700 (PDT) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id ch11si1989382ved.139.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Aug 2013 04:47:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.42; Received: by mail-vb0-f42.google.com with SMTP id e12so217176vbg.29 for ; Wed, 21 Aug 2013 04:47:25 -0700 (PDT) X-Gm-Message-State: ALoCoQnFmO/z+kiGR8BOXGc/To/ueqFxuSGqhYiuOpHCpFrxYGjBuCd0rhfnVG4GnsvMVwnS9mVb X-Received: by 10.58.155.68 with SMTP id vu4mr6148370veb.21.1377085645445; Wed, 21 Aug 2013 04:47:25 -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.220.174.196 with SMTP id u4csp214648vcz; Wed, 21 Aug 2013 04:47:24 -0700 (PDT) X-Received: by 10.15.43.197 with SMTP id x45mr268301eev.74.1377085644102; Wed, 21 Aug 2013 04:47:24 -0700 (PDT) Received: from mail-ea0-f178.google.com (mail-ea0-f178.google.com [209.85.215.178]) by mx.google.com with ESMTPS id x42si6388568eel.56.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Aug 2013 04:47:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.215.178; Received: by mail-ea0-f178.google.com with SMTP id a15so174861eae.23 for ; Wed, 21 Aug 2013 04:47:23 -0700 (PDT) X-Received: by 10.14.224.198 with SMTP id x46mr3012685eep.53.1377085643569; Wed, 21 Aug 2013 04:47:23 -0700 (PDT) Received: from localhost.localdomain (cpc15-aztw25-2-0-cust493.aztw.cable.virginmedia.com. [92.233.57.238]) by mx.google.com with ESMTPSA id a6sm9180579eei.10.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Aug 2013 04:47:23 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@linaro.org, Lee Jones , Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Dan Carpenter Subject: [PATCH] usb: musb: ux500: Add check for NULL board data Date: Wed, 21 Aug 2013 12:47:03 +0100 Message-Id: <1377085623-8773-1-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.1.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.42 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: , Dan Carpenter's automatic Smatch checker found an anomaly in the ux500 MUSB driver, whereby board data was checked before use in all but one occasion. It is believed that it needs to be checked every time. Smatch complaint: drivers/usb/musb/ux500_dma.c:335 ux500_dma_controller_start() error: we previously assumed 'data' could be null (see line 313) Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: Dan Carpenter Signed-off-by: Lee Jones --- drivers/usb/musb/ux500_dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c index bfb7a65..679f511 100644 --- a/drivers/usb/musb/ux500_dma.c +++ b/drivers/usb/musb/ux500_dma.c @@ -339,7 +339,9 @@ static int ux500_dma_controller_start(struct dma_controller *c) if (!ux500_channel->dma_chan) ux500_channel->dma_chan = dma_request_channel(mask, - data->dma_filter, + data ? + data->dma_filter : + NULL, param_array[ch_num]); if (!ux500_channel->dma_chan) {