From patchwork Fri Mar 1 05:03:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 10834471 Return-Path: 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 A2D7E1399 for ; Fri, 1 Mar 2019 05:03:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EDF42F728 for ; Fri, 1 Mar 2019 05:03:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 825FE2F72E; Fri, 1 Mar 2019 05:03:38 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E22102F728 for ; Fri, 1 Mar 2019 05:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iShgbJgSh8Z9Z5xriiswSfF1T2jlVluH1wRXiXpiSL8=; b=NkdCMIK0WZXepN H8dpKrRyi+Eur5IuKF4UktJZjsFDC1g6iAs/8KD2g7jNoVuQkXWVmVyfjJMCtXCgcocRzPGdGsaXv pxJ8x9jkCb2+GtHLoQGlKrz/HuL3IVDBkMye67KVIcfRlW6HTSdsa47xy/u0lPMBGAThUgLIKhsSu F1CRn6fAcpoJUYcyulrtJgAWBxjogStUfWOv7jv5JWl0ArxwCDeM5SUQZZ3SHW/62WsUYHpRP+/e1 yQj8lSETkQkM42OhLvIuJdMuoLjLOEwtw4Sz+nAMlFtmtm71BqgADn7gtPKoAx26ODbfoS0OtAncM sC1DOElC96RORYWQCPsA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzaKa-0006pw-VY; Fri, 01 Mar 2019 05:03:32 +0000 Received: from mail-eopbgr700087.outbound.protection.outlook.com ([40.107.70.87] helo=NAM04-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzaKX-0006pI-GM for linux-arm-kernel@lists.infradead.org; Fri, 01 Mar 2019 05:03:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector1-synaptics-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GLJ+7n76v5no2fVLihRLttvC7XT4DSHydHDSGRjxfdM=; b=qiC1GjHeHCc7BkDhNJ82jRSm+ZX40u7oUZCHFQetuE+StmiVUzPLoQMKBvTJr1rlCkKYwkmLa7DT07PFnFmHIrYcrHF4AIs6M549lEs3PgUlR6KadqpOUGoWc850ZAWn5J+ROb/Cgt6Iee5grnYy0wYKbCGQxalMnDKyVkXiYWY= Received: from BYAPR03MB4773.namprd03.prod.outlook.com (20.179.92.152) by BYAPR03MB4533.namprd03.prod.outlook.com (20.178.50.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.15; Fri, 1 Mar 2019 05:03:27 +0000 Received: from BYAPR03MB4773.namprd03.prod.outlook.com ([fe80::1cca:e5f5:d31d:1e5c]) by BYAPR03MB4773.namprd03.prod.outlook.com ([fe80::1cca:e5f5:d31d:1e5c%5]) with mapi id 15.20.1665.015; Fri, 1 Mar 2019 05:03:27 +0000 From: Jisheng Zhang To: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Bjorn Helgaas Subject: [PATCH v2 1/5] PCI: dwc: Fix dw_pcie_free_msi() if msi_irq is invalid Thread-Topic: [PATCH v2 1/5] PCI: dwc: Fix dw_pcie_free_msi() if msi_irq is invalid Thread-Index: AQHUz+waTBymEGCS70GGZnCc5RmlDA== Date: Fri, 1 Mar 2019 05:03:27 +0000 Message-ID: <20190301125625.4e15d869@xhacker.debian> References: <20190301125510.4e2ee985@xhacker.debian> In-Reply-To: <20190301125510.4e2ee985@xhacker.debian> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [199.33.119.15] x-clientproxiedby: TYCPR01CA0105.jpnprd01.prod.outlook.com (2603:1096:405:4::21) To BYAPR03MB4773.namprd03.prod.outlook.com (2603:10b6:a03:134::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 90f96ce6-6fe8-4816-63e7-08d69e033d38 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:BYAPR03MB4533; x-ms-traffictypediagnostic: BYAPR03MB4533: x-microsoft-exchange-diagnostics: =?us-ascii?Q?1; BY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9dL6Ktnja7DpEjiyA0rmI47u6Bwt53GR3bLdmYsdx4EcEP9KueOzGWa9V/OcOt8Q/yG+sIaprLAqFUXqKicNKw6JMCrkhE7QYA2OoJ2qwIGx3chxLMtcK/SmQ2Xv51YQ3Us2IPCVeD++DTTae1q6eja3HOwMFvq6kfxexcqdAlMUW8vmclNNb+w3kLRuIiwtrTbbhUhRUiI= x-microsoft-antispam-prvs: x-forefront-prvs: 09634B1196 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(39860400002)(396003)(136003)(376002)(199004)(189003)(86362001)(316002)(11346002)(97736004)(6486002)(76176011)(66066001)(25786009)(4326008)(68736007)(102836004)(50226002)(4744005)(5660300002)(476003)(6436002)(2906002)(54906003)(1076003)(9686003)(106356001)(7736002)(386003)(8936002)(3846002)(14454004)(71200400001)(478600001)(71190400001)(186003)(81166006)(81156014)(6116002)(72206003)(256004)(446003)(305945005)(52116002)(53936002)(110136005)(26005)(8676002)(99286004)(486006)(6506007)(6512007)(105586002)(39210200001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR03MB4533; H:BYAPR03MB4773.namprd03.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:0; MX:1; received-spf: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 8g8J+qdS9g5TUTWCMDCNBrK5eAT3MPnwAiVvmOvC9Jw1NpEjWD+3nZKfsVC2ILbu0FRXy2TlmZ+Ay8+ctJ1UUyFBUrj1H+6qynBspv7XyOBgLjT9qUAHqZI/e7Ri6Qv+oMtLswpv+pc14FMNcovVv3S1cdEVQDxNOJJt1Ugue2IKJCWa0SIdgwUh4rQ3NK6LmkDrJTyaQ1Y51rt3QQ/0ef71SOD6T9PQtlp9/9zJmMzrGdYPQOdciRqchLEln9CqRbTFxR7zmJJqUExCIA+GEhpCpwuhCCSR/8lZZ7P508oBZTnMInSiARO34nY4cYEbHt+SJouv3ybpfielUPC+S1C2CN8+nzuM7Rru4eQ6ubTb1T2YDkOgrJUDJRtyuDed6XmJ/f79RsZtfie/e+bH9SHJZypl1RC90LRQrpN1dzM= Content-ID: <0A6E8DFAE4A6AE44B8D06088BA71A512@namprd03.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90f96ce6-6fe8-4816-63e7-08d69e033d38 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2019 05:03:27.2282 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB4533 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190228_210329_544673_ECFBE8ED X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP We should check msi_irq before calling irq_set_chained_handler() and irq_set_handler_data(). Signed-off-by: Jisheng Zhang Acked-by: Gustavo Pimentel --- drivers/pci/controller/dwc/pcie-designware-host.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 0c18ab63811f..a94d3530b694 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -298,8 +298,10 @@ int dw_pcie_allocate_domains(struct pcie_port *pp) void dw_pcie_free_msi(struct pcie_port *pp) { - irq_set_chained_handler(pp->msi_irq, NULL); - irq_set_handler_data(pp->msi_irq, NULL); + if (pp->msi_irq) { + irq_set_chained_handler(pp->msi_irq, NULL); + irq_set_handler_data(pp->msi_irq, NULL); + } irq_domain_remove(pp->msi_domain); irq_domain_remove(pp->irq_domain);