Message ID | 20181224011625.10299-1-peter.chen@nxp.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | 8ff396fe56f5593640a8ce7223cac33a2cda619e |
Headers | show
Return-Path: <linux-usb-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A74FF1399 for <patchwork-linux-usb@patchwork.kernel.org>; Mon, 24 Dec 2018 01:19:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E5B71FF83 for <patchwork-linux-usb@patchwork.kernel.org>; Mon, 24 Dec 2018 01:19:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 816481FFDB; Mon, 24 Dec 2018 01:19:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F2541FF83 for <patchwork-linux-usb@patchwork.kernel.org>; Mon, 24 Dec 2018 01:19:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726388AbeLXBS5 (ORCPT <rfc822;patchwork-linux-usb@patchwork.kernel.org>); Sun, 23 Dec 2018 20:18:57 -0500 Received: from mail-eopbgr30045.outbound.protection.outlook.com ([40.107.3.45]:19536 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726016AbeLXBS5 (ORCPT <rfc822;linux-usb@vger.kernel.org>); Sun, 23 Dec 2018 20:18:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l9K6GyJvZlaJHeJeCereEIArK/uYzQ4kuUD7dBNPMi4=; b=haRgcR7yaZ8RyGNU+UqYIzoOcATrtW1neoTZvRmAz6w+3+sYEhilEPMZ5AvO0eVgzglRjEPBYR/VJe4fFACrb5KbYrCtDIeVMg6lxeB5z1c814kVghiSVpNSdg5sZJqSu2stsEcGuOezTzUfgzACvg66wVzaiRMYsB6jn5wJLfs= Received: from VI1PR04MB5327.eurprd04.prod.outlook.com (20.177.52.16) by VI1PR04MB1566.eurprd04.prod.outlook.com (10.164.84.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.19; Mon, 24 Dec 2018 01:18:51 +0000 Received: from VI1PR04MB5327.eurprd04.prod.outlook.com ([fe80::c92b:a786:d2c5:fa1e]) by VI1PR04MB5327.eurprd04.prod.outlook.com ([fe80::c92b:a786:d2c5:fa1e%3]) with mapi id 15.20.1446.026; Mon, 24 Dec 2018 01:18:51 +0000 From: Peter Chen <peter.chen@nxp.com> To: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org> CC: dl-linux-imx <linux-imx@nxp.com>, "dan.carpenter@oracle.com" <dan.carpenter@oracle.com>, Peter Chen <peter.chen@nxp.com> Subject: [PATCH 1/1] usb: chipidea: fix static checker warning for NULL pointer Thread-Topic: [PATCH 1/1] usb: chipidea: fix static checker warning for NULL pointer Thread-Index: AQHUmyahLtVl30JxXE27MXLFXWL2rQ== Date: Mon, 24 Dec 2018 01:18:51 +0000 Message-ID: <20181224011625.10299-1-peter.chen@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.14.1 x-clientproxiedby: HK0PR01CA0052.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::16) To VI1PR04MB5327.eurprd04.prod.outlook.com (2603:10a6:803:60::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peter.chen@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB1566;6:b5vmdCS6uM5K6qutcOn0aYarvDaLSgNB/3Dd/CwOokx23NyvIC05/fsFHbHzHe78te97/6jhr7ec0y1gTewY0331ISBr2bEW7nDDml7ZjFSdYG+KKj2v8KUTrAYk20u8WOXZZpM4OQNcvnsebIoVjSzXpZ0o4cOyJExgn+RvoGlUulmIJHKAt37+/AcvmDy4OOj2CbY1tv/WQpAWWoCNVweO27b/H1+952AC31xfGWQ+rUcQKPsrb/o5dsxyg6VrqONRC1m56BXHU+OlSmv4DKwPjTK5nxNlQ0hCR++9rMFsHBRvRm5+fvjNwYjVViStpDGtr2fSOcfZBkdtqxVQd1z9EmMsBDp6Uo11a8/Kb1k2+kX6rKwYqzhTIjJR25RLssJbxBX7bd/cHaB7KnXLFufzZx9CkHHUSJ9NyaSWe9OEoG91SCTb2GQkcoJRyjwnwEaqXFxrnDF9rUINDpyrIw==;5:YS9YMeX4jzNXqjSWlK3bRCauflcpR3cdP0NbTrBmV23yzdF2anOWeZsGUmkzGHyZGR6nd/B63BnQw9ODWs9DCHj2rlN/+08SW53wjTIfm7fhSMpWNDys0R6B98mdg5bXIpkqcwfifmoofR2ZVRNj7ZhYgNKbA4Aud5P5KcrQme4=;7:hpSxB3OtlriJgsdtaFosEJxE2RALf5HrrO3dhCuFtMTda2FtgforddnLdTd13jzS/zqwqTxqz1lzoRcLSxSYrN0O46qnnNAK/x7/V4Z/cQ2agqMSowYjppxZBcMBHmg+8Qsn9KXlMWzx5Z89WhMiAg== x-ms-office365-filtering-correlation-id: 95de44f8-3507-4bef-6d19-08d6693dc358 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB1566; x-ms-traffictypediagnostic: VI1PR04MB1566: x-microsoft-antispam-prvs: <VI1PR04MB156636F6F5484CC2848652558BBB0@VI1PR04MB1566.eurprd04.prod.outlook.com> x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(93006095)(93001095)(3231475)(944501520)(52105112)(10201501046)(3002001)(6055026)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB1566;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB1566; x-forefront-prvs: 0896BFCE6C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(346002)(396003)(136003)(376002)(366004)(189003)(199004)(86362001)(53936002)(99286004)(6916009)(6512007)(2906002)(1076003)(14444005)(256004)(68736007)(36756003)(66066001)(305945005)(102836004)(5660300001)(186003)(26005)(6506007)(386003)(52116002)(44832011)(6436002)(486006)(6486002)(5640700003)(2351001)(106356001)(105586002)(476003)(2616005)(478600001)(50226002)(2501003)(71190400001)(71200400001)(8676002)(7736002)(14454004)(54906003)(3846002)(316002)(4326008)(81166006)(81156014)(8936002)(6116002)(97736004)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB1566;H:VI1PR04MB5327.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: n4SBiReIyTGyxzbdxRJWDuAPe3W8iqLB2AJ8DQ4XDaHBNNh9BxWDdffMOD34bQyXSMPxy0Dut/WAPSkc/4pPCKIfhYVn0nfNUrAn8zqK7JTMX6ZPKeug5excQFgCiK2kAld02/dalWLa5hYXkjvcGwNgXqVAGlpzNuNWAAd9fchr9K5XXEMgYRzh9jX5nQkErhSiUl3fiyPCVJ6XFypfsblJ6YbafcbeQC+igGJppuBnnEiow8IAA4sBJwY3q90unA1fLdnZ6iuWWr8ABD8dul1tM7XrSm/+jxbDntLlMglGYkytYGKodtv/KiY3Y/VM spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95de44f8-3507-4bef-6d19-08d6693dc358 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Dec 2018 01:18:51.7340 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB1566 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: <linux-usb.vger.kernel.org> X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
[1/1] usb: chipidea: fix static checker warning for NULL pointer
|
expand
|
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index e81de9ca8729..9b45aa422e69 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -316,7 +316,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) if (IS_ERR(data->usbmisc_data)) return PTR_ERR(data->usbmisc_data); - if (of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC) { + if ((of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC) + && data->usbmisc_data) { pdata.flags |= CI_HDRC_IMX_IS_HSIC; data->usbmisc_data->hsic = 1; data->pinctrl = devm_pinctrl_get(dev);
During the static checker, "data->usbmisc_data" may be NULL. Fix it by this pointer judgement before using. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> --- drivers/usb/chipidea/ci_hdrc_imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)