Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3967009pxk; Tue, 29 Sep 2020 10:32:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ+QZ0ZPGTyh3ucLtAk8QnbmpScVpvruzK9hBfzXE4csoJco02PYc4QoBE9MbAiP0NQ+5X X-Received: by 2002:a17:906:b47:: with SMTP id v7mr4849497ejg.310.1601400745949; Tue, 29 Sep 2020 10:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601400745; cv=none; d=google.com; s=arc-20160816; b=ESMfTvrD9WghPmTFhkJqgegXBrSBQapvxJZjLakyGMAPvw/hshtqra5xtxaKa4RQ0n fiqsKzLe5aBBP3yCHIfRJpD2j+ek/AuKNst06jfbMpb0CEADP0BsJsIkHEm04CycjpTg KhncvqVydRo9L6ICMKC+pWSYguefRk4UB02KCs3T2KQWg6gn/1bPcKej6uWwu7UhdGRw Do0kJDMsJzwcleoUwrov+OeducXwIX6DVnFAFokjAwctKtn/CG9/RBGtjigzEAe8vu6M aydk/uvexFvGtywb3o5bLRZGm3xbh5fQASGFe7nDr0ry1WdvN6jhI+mgDCvWZCOXa4mW gVlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version; bh=KWY3iKBOM3VAizL5kGTVfbqMtDP6G+S4KUKWbxwD6aI=; b=dlwBt6O0kJOOly3ixL5q4zP6eqa49FnPcExuGzMduryCvqs/dXJmLjk3wnmvmuEAKS Jnu4H2cCkNtFW1nBaMHXraQKOOsoBBXHH4Cbp/BeRGGS7JtDpv4ijFjb7pzlcmWmDhfd b0a8AoFzr83KOZkaUKxGZrnEjyJkSnWmKE9q+NvzeWtvyzQmLh0yX79QB36ZCfMtMSvE E8IRiWyQXCv9kMICzx8ojBArUPvQMdhSQy3CbxgUI7FPOOF5qNrjWICMUtKNKhel2Xed MidY45dRvmVv+cyuwalwQGkOsHN9VHt+TMTGgqWZ61mAG7jyrE4XK9dHaHaBOQxMnxwH xK4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j15si3229220ejs.51.2020.09.29.10.32.02; Tue, 29 Sep 2020 10:32:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729061AbgI2Ra2 (ORCPT + 99 others); Tue, 29 Sep 2020 13:30:28 -0400 Received: from disco-boy.misterjones.org ([51.254.78.96]:42878 "EHLO disco-boy.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727328AbgI2Ra1 (ORCPT ); Tue, 29 Sep 2020 13:30:27 -0400 Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kNJRo-00FuDq-Bp; Tue, 29 Sep 2020 18:29:52 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 29 Sep 2020 18:29:52 +0100 From: Marc Zyngier To: Jisheng Zhang Cc: Kishon Vijay Abraham I , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Jingoo Han , Kukjin Kim , Krzysztof Kozlowski , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Yue Wang , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Jesper Nilsson , Gustavo Pimentel , Xiaowei Song , Binghui Wang , Andy Gross , Bjorn Andersson , Stanimir Varbanov , Pratyush Anand , Thierry Reding , Jonathan Hunter , Kunihiko Hayashi , Masahiro Yamada , linux-samsung-soc@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 2/5] PCI: dwc: Check alloc_page() return value In-Reply-To: <20200924190623.3251c2ac@xhacker.debian> References: <20200924190421.549cb8fc@xhacker.debian> <20200924190623.3251c2ac@xhacker.debian> User-Agent: Roundcube Webmail/1.4.8 Message-ID: <74af578c79bd09f2111e5438917f2c6e@misterjones.org> X-Sender: maz@misterjones.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: Jisheng.Zhang@synaptics.com, kishon@ti.com, lorenzo.pieralisi@arm.com, robh@kernel.org, bhelgaas@google.com, jingoohan1@gmail.com, kgene@kernel.org, krzk@kernel.org, hongxing.zhu@nxp.com, l.stach@pengutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, yue.wang@amlogic.com, khilman@baylibre.com, narmstrong@baylibre.com, jbrunet@baylibre.com, martin.blumenstingl@googlemail.com, jesper.nilsson@axis.com, gustavo.pimentel@synopsys.com, songxiaowei@hisilicon.com, wangbinghui@hisilicon.com, agross@kernel.org, bjorn.andersson@linaro.org, svarbanov@mm-sol.com, pratyush.anand@gmail.com, thierry.reding@gmail.com, jonathanh@nvidia.com, hayashi.kunihiko@socionext.com, yamada.masahiro@socionext.com, linux-samsung-soc@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@misterjones.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-09-24 12:06, Jisheng Zhang wrote: > We need to check alloc_page() succeed or not before continuing. > > Signed-off-by: Jisheng Zhang > --- > drivers/pci/controller/dwc/pcie-designware-host.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c > b/drivers/pci/controller/dwc/pcie-designware-host.c > index 0a19de946351..9e04e8ef3aa4 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > @@ -303,6 +303,11 @@ void dw_pcie_msi_init(struct pcie_port *pp) > u64 msi_target; > > pp->msi_page = alloc_page(GFP_KERNEL); > + if (!pp->msi_page) { > + dev_err(dev, "Failed to alloc MSI page\n"); A failing allocation will already scream, so there is no need to add insult to injury. More importantly, what is this MSI page ever used for? If I remember well, this is just a random address that never gets written to. So why do we allocate a page here? Why do we bother with this DMA mapping? M. -- Who you jivin' with that Cosmik Debris?