Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp951198rwb; Fri, 7 Oct 2022 06:22:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4THki7v9MGSVlyywKgu92cL/ihWTlLk7qNe2kp94vrhABcyrMDQrgD61IJw9SiZU+bHCQJ X-Received: by 2002:a17:907:1b1e:b0:783:8e33:2d1c with SMTP id mp30-20020a1709071b1e00b007838e332d1cmr4038708ejc.304.1665148930129; Fri, 07 Oct 2022 06:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665148930; cv=none; d=google.com; s=arc-20160816; b=l6W5n1uqpclqj7WA1to01YC+7NAdrdrs/5+21fzHpTLJoviKXds14S2kCzc1p5Dn17 pjKe5hcWmrx7OEvdgjkU02H8HOwztGGjOEX8K8+aQv/xMfLEjOEwVDxVDq7yc4iQ69GR Um6g+ep6kRHfrIKEBgiw30sISHtRdHglPS7bstMI76UlCMFFX3uRXUYbrHdDlN9k7EMp 1gk7TL+IcZaRsPrbX5sRNVtPLFrghYgGUN7B1Pr9kaGjQAQFhk4vChLdgX19QYD7USKd BDLZH8cMbV4yCsJusMSMa5KJiEA2EXFIBMyzHLz2pYejyAEJ67YG1Yn6U9ciI3rDl9su sgzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=/D5BpqxGIY06Sm2m+Wp50j6kCqsStWrPU3y0SL4MsRw=; b=NV2C83FhYOMHLk9avagx64hWict5D8V1YIoFSX5QwWLZD7UUWcD180Hve4yRAhxXjq hIJdy3rbgXcjvUT0KLcuDl4SHU+jgMWd6ZUdFf+c1R3KTHL9GowHpBK60eSEUKprx3j9 enR9Ns5b73aN/sxrUa3fCNbDkNX1Ya6x+j8RBhoWl8jZlhcq/lS3/rLkUaoe5otHd0Dw eWLvA+H5ecwYzwr3U1+NlN+26lxzjWCwOdPTpU7vm+oi3sIL/A2MQi8/uZKm0TZqaSag uyL5IuBTSjNu3NQjEfLHPf626Ei7/kSFsSs5rqZBYI7YsR5X6cMa1a6RGBgDJ9soP856 lV1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XxoCU85j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eg52-20020a05640228b400b00458ff6921e6si1840977edb.79.2022.10.07.06.21.43; Fri, 07 Oct 2022 06:22:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XxoCU85j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229853AbiJGNPn (ORCPT + 99 others); Fri, 7 Oct 2022 09:15:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbiJGNPl (ORCPT ); Fri, 7 Oct 2022 09:15:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E73784E7E; Fri, 7 Oct 2022 06:15:40 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id ED40BB822E4; 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220924032127.313156-1-sunke32@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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