From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB65AC4332F for ; Fri, 7 Oct 2022 13:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rkNg+V6hie/Bxdm0zihRX5nrBmLnUl+xQot/oW2lZSA=; b=r+v13WMagyOiQ6 kfs8oHvO+5XyNA1aleea+5F6U9ACn73qBi3AKx5IPMlsOvajCAcr1CZ81+1IZQdY3LhcmxH3OOEdE No+Kyurdhn81KUjJsTrv5dpx8M9nILTBmJCfcPIBcAPcDvnI1Sbw0UWbz2SesJHemoWywtkTFoUY0 yAzsJy8vHuYiIw/2bECfCjvZEbyJleMNosWJICl55GoYyy3cPRwX+U6k72V8aRJeg2fRD802igwA0 75JE0KmhH9AM9MfXJUTsmqiu9jcNpQwyorAoWAY9qVbJqDuNiB0aYP1zp+44hBpRNkk6cy8lx2O+w mg1GrprCzmIhyB1Pe+SQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ognCb-0094Dx-C5; Fri, 07 Oct 2022 13:15:45 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ognCV-0094DU-9a for linux-arm-kernel@lists.infradead.org; Fri, 07 Oct 2022 13:15:43 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3BD8261C4E; Fri, 7 Oct 2022 13:15:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 311D1C433C1; Fri, 7 Oct 2022 13:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665148537; bh=qDQjV6c5Y6GnUrWjc3kbcVPC14TyP0441OSeC6p4DQg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XxoCU85jZtz70BMnbtoU6br731dgFcwenXJ8AKlCa6yCCT45HZ4emadkfwtbf0AOa toktV6MSku47ocMv/Y0uiBQZAjd432DmelmNgC8IsGkan6jGhWagCf96WAt26OJlPJ /jqvHud+uzHd1Wc8K6vwUT89S7HxanKgoACJ3BJo8KEKKlt7mfIi/hderJVlJa9h74 Wyh1SlZg/Eovvx7Rg5Kw+oopB7nChyQlGgjxasJcowMZamSizQOD71tN+nZn2azIHm TrOiz5Gk2XKwGBKxo6Flgcmm2xShM9NzXht465PIBpDKwBPTiKM5LJvHhk39rx+N1/ +tsMloR27o6zw== Date: Fri, 7 Oct 2022 14:15:32 +0100 From: Will Deacon To: Sun Ke , catalin.marinas@arm.com Cc: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, xueshuai@linux.alibaba.com Subject: Re: [PATCH] drivers/perf: fix return value check in ali_drw_pmu_probe() Message-ID: <20221007131531.GA26341@willie-the-truck> References: <20220924032127.313156-1-sunke32@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220924032127.313156-1-sunke32@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221007_061539_409262_3BE95816 X-CRM114-Status: GOOD ( 19.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Sep 24, 2022 at 11:21:27AM +0800, Sun Ke wrote: > In case of error, devm_ioremap_resource() returns ERR_PTR(), > and never returns NULL. The NULL test in the return value > check should be replaced with IS_ERR(). > > Fixes: cf7b61073e45 ("drivers/perf: add DDR Sub-System Driveway PMU driver for Yitian 710 SoC") > Signed-off-by: Sun Ke > --- > drivers/perf/alibaba_uncore_drw_pmu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/perf/alibaba_uncore_drw_pmu.c b/drivers/perf/alibaba_uncore_drw_pmu.c > index 82729b874f09..a7689fecb49d 100644 > --- a/drivers/perf/alibaba_uncore_drw_pmu.c > +++ b/drivers/perf/alibaba_uncore_drw_pmu.c > @@ -658,8 +658,8 @@ static int ali_drw_pmu_probe(struct platform_device *pdev) > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > drw_pmu->cfg_base = devm_ioremap_resource(&pdev->dev, res); > - if (!drw_pmu->cfg_base) > - return -ENOMEM; > + if (IS_ERR(drw_pmu->cfg_base)) > + return PTR_ERR(drw_pmu->cfg_base); > > name = devm_kasprintf(drw_pmu->dev, GFP_KERNEL, "ali_drw_%llx", > (u64) (res->start >> ALI_DRW_PMU_PA_SHIFT)); Acked-by: Will Deacon Catalin can pick this one up as a fix. Cheers, Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel