Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFEE0C433E2 for ; Mon, 14 Sep 2020 11:29:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CDCA208DB for ; Mon, 14 Sep 2020 11:29:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bt3yQ+er"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="rCXdm3mH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CDCA208DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=WQLwKzd8+t1ZXJuEduCSWal7GYQA9G/G03rlsA5ihr0=; b=bt3yQ+er/WkkrP9XYNBrnZGqi /W20IgGfphhzLd6+wQHgs/AWC2Du0cvdS1/rNABTWfqcHLrEKpa8BUmslbHJWIHiy0p74MxMLcqwV BoZlEceem+LzcrmPnQ3tSL6tGSuI907MrRis10+5M95TskhR5zF0eDhr7X7/4swGr9n4HdBzM23hO QkPMYFrRsO78D9k3LEUlCb6QsdbtSxQfVWSba7xiCUKIV1u5hdZBwlhAy7ibwXgQmpH1v8rT7QQRE 8OL2cMdHJ3cMS3h022jF+qYenJnLILrBaT0P+ysDvS/sHrKRIpa3sm0h9tfpMWr7o94j1LiFzVM3s cFqV+/nvg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHmea-0004n9-M6; Mon, 14 Sep 2020 11:28:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHmeY-0004g7-Fy for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 11:28:11 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B185D216C4; Mon, 14 Sep 2020 11:28:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600082888; bh=LD8gKfq3+M60A9fkVwtz5N1wN5RFsUcksTxvGuoEBr4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rCXdm3mH4nZTgySe0Df0IfxBSbZSiJeZOD3cinDUh6HQHt/AZE/IuWIZ05PGlegVy Q9lkl/AGuTd5Z9Thoapgv8scMIg5OFQ277Cf4Xczsvlzyc0DD0OdzIn9dAlcU/fdk7 5SipduQ6w15WyHR6gsWFZWNakkNN3pKiB9OimdvM= Date: Mon, 14 Sep 2020 12:28:04 +0100 From: Will Deacon To: Mark Salter Subject: Re: [PATCH v2] drivers/perf: xgene_pmu: Fix uninitialized resource struct Message-ID: <20200914112803.GA24312@willie-the-truck> References: <20200913174536.207265-1-msalter@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200913174536.207265-1-msalter@redhat.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-20200914_072810_619137_83F9949C X-CRM114-Status: GOOD ( 14.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Khuong Dinh , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 Sun, Sep 13, 2020 at 01:45:36PM -0400, Mark Salter wrote: > @@ -1483,11 +1473,23 @@ xgene_pmu_dev_ctx *acpi_get_pmu_hw_inf(struct xgene_pmu *xgene_pmu, > return NULL; > > INIT_LIST_HEAD(&resource_list); > - rc = acpi_dev_get_resources(adev, &resource_list, > - acpi_pmu_dev_add_resource, &res); > + rc = acpi_dev_get_resources(adev, &resource_list, NULL, NULL); > + if (rc <= 0) { > + dev_err(dev, "PMU type %d: No resources found\n", type); > + return NULL; > + } > + > + list_for_each_entry(rentry, &resource_list, node) { > + if (resource_type(rentry->res) == IORESOURCE_MEM) { > + res = *rentry->res; > + rentry = NULL; > + break; > + } > + } > acpi_dev_free_resource_list(&resource_list); > - if (rc < 0) { > - dev_err(dev, "PMU type %d: No resource address found\n", type); > + > + if (rentry) { I'm curious as to why you've had to change the failure logic here, setting rentry to NULL instead of checking 'rentry->res' like the TX2 driver (which I don't immediately understand at first glance). Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel