Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2856050imc; Wed, 13 Mar 2019 03:06:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyb7cROJQtBq2xmK2hiuXD74zpU+/n2i5x0qk7wZXLAd63ss1zAn9PD/ahl0zYvPyc4djTj X-Received: by 2002:a65:6148:: with SMTP id o8mr39598685pgv.442.1552471571941; Wed, 13 Mar 2019 03:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552471571; cv=none; d=google.com; s=arc-20160816; b=dVJkrkAeGEgGit0thUOqDwRWiePxhOHFMCYWjFfgQnAHmGKPQkXP3GB4EpDCTy+bbc ZRi8Awg4szDTHHKlJny5gJowjFDolrqBikp1R0AOdr6/AIkDXdUJLV6kQ93VERuRTHqk r9iFxH6BPcELo4FJfCLT38XaD2r7VeT00C6/BGJ2FwRZ84MtLdzYIeEEFVcf0YpfcsZN D9YVXZUyHCp7lup+FIpXYghPIjs5imVtW6cM53FwrTu5zW6NV+M6YB+u1xedv7IpIysR 0PjPSAf4eH1qt9S+ZMwIW6WuylkvsB2gnhfPkcKHUfDB4266AmA/cSLRwpGAn9uEeluv O2Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=LPdtJVOBFT6UzDqUAzL4dYf0sSDJ9Ce0DJl9vPbv9Eg=; b=NVaW0YskUboV/KtJob9UeRbEvcIju+UwP/9+9/CGFPynh6ZR9HMTwoR+Dpk8ek3FJx dIW8Nv6gKeXSvYDGDZb/xE/MfTiXvq/DbE/C+84EAKOyBcETYL+8QiwWR1IIp0FtafL8 4EyTOIKhSdZsVuPVfqZdiE/unU6u8UTc5ujhG52hA5jO1MpKwTwZHCeumWzbXkWYBRxS RFayAoPp2vD8yqtshDk2p8fN+ir+yEvO0PvU0XVRWeCJJhrDgtJD2pUwpokFnw8gPqJ6 y3ktIC8cWPZ1vEZPCFLlhUjyfv4yLd1madPltof711O10S6WnPt/TqMsaPf156X/7fiy N/KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=FosqpDgx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q19si9841091pff.177.2019.03.13.03.05.55; Wed, 13 Mar 2019 03:06:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=FosqpDgx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726326AbfCMKFe (ORCPT + 99 others); Wed, 13 Mar 2019 06:05:34 -0400 Received: from smtprelay2.synopsys.com ([198.182.60.111]:34908 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbfCMKFe (ORCPT ); Wed, 13 Mar 2019 06:05:34 -0400 Received: from mailhost.synopsys.com (badc-mailhost2.synopsys.com [10.192.0.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtprelay.synopsys.com (Postfix) with ESMTPS id BA6E010C1E4D; Wed, 13 Mar 2019 03:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1552471533; bh=Z+xGZYnutxceKMnuby8zql687TXvUYPRaNKAXZ01Y6g=; h=Subject:To:CC:References:From:Date:In-Reply-To:From; b=FosqpDgxeKrSY29WtJoqACzFROVzFVlYv4Joq1OYq3u74vavqCOi/Z3yTd/pZpOga NzJmH2T6KSFVwiN0b00IWy/KjG0MDpMNraH7+o3tiDgSVwibWl/Kca/yLOX5PuCB+e rEmvNYTTrfA/8nJdNX6wP35xe4qHUa1lTiyQsvufwhfAkVskRs+730dJQXTxVyK/uL ChzBEtcayStLh0ACIotW+0JUGx/kM7DZqk+qcadha2aHJtJr+fE0HVjIWsRp1gOuFT vt+7Sfg5E4emPukNlaSrSk2plnQXpF8zz2ixXVmce4qcKrj0dSfUIpnlQpp0soTHGw BZ3NP8so/EjDQ== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id 57B52A0067; Wed, 13 Mar 2019 10:05:28 +0000 (UTC) Received: from DE02WEHTCB.internal.synopsys.com (10.225.19.94) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Mar 2019 03:05:28 -0700 Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.92) by DE02WEHTCB.internal.synopsys.com (10.225.19.94) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Mar 2019 11:05:26 +0100 Received: from [10.107.19.55] (10.107.19.55) by DE02WEHTCA.internal.synopsys.com (10.225.19.80) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Mar 2019 11:05:25 +0100 Subject: Re: [PATCH v2 1/5] PCI: dwc: Fix dw_pcie_free_msi() if msi_irq is invalid To: Jisheng Zhang , Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Bjorn Helgaas CC: "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" References: <20190301125510.4e2ee985@xhacker.debian> <20190301125625.4e15d869@xhacker.debian> From: Gustavo Pimentel Message-ID: <8a0bda6b-6879-e4ac-cfe6-171abbd72abd@synopsys.com> Date: Wed, 13 Mar 2019 10:05:24 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190301125625.4e15d869@xhacker.debian> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.107.19.55] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/03/2019 05:03, Jisheng Zhang wrote: > We should check msi_irq before calling irq_set_chained_handler() and > irq_set_handler_data(). > > Signed-off-by: Jisheng Zhang > --- > 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); > Sounds good. Acked-by: Gustavo Pimentel