Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp3168939pxy; Wed, 4 Aug 2021 04:12:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD/6SzWAqS+FoWYMLvd5I5QNLmjUN5JUUzg/qdX+S4x8IP7Q5QGUfwslxsiiBa9ZID1NMr X-Received: by 2002:a17:906:2bd4:: with SMTP id n20mr25422194ejg.390.1628075568061; Wed, 04 Aug 2021 04:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628075568; cv=none; d=google.com; s=arc-20160816; b=rrZKHYcEOh7v4INtGvn0skln/ea9gM89X7IsXdzKSCvCtML0ajvk3p6XV7jNmwThfB 1yiz2ydS9wQ5pdrXr2AZBfAnCKmQVsGswTPuVfVtDxDqZT8PE25+DSB8shnsQjizFOdK o38X7wE6pfUM01x3eCxEUdAGSzueTAIywwrCdsZ5F3nrF7yc5BMzqYCRABV7qjoRCnuf eaJrWI3Y7kXIF0sAks8ouM6PBvdBJRWwHZ7K6g76yAbUUrDpDQJUpqtm9/gF9gYvv/fk ILa7ogSz6vZ3RF8anNVbzPEvk1SZxAMeMUK7cJBM32mRyXzYGSW+Ks4AxZN0qUSYP2+d hAZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=WUWFq62bRJlU0CDbali06Ktby0foS3az0NWkh7h2paw=; b=HtD95VOsX15mei6BjzdAfxRMY/uqmPOIJxJdKi1Zq0YxAsBNFIWHBnMIu079GnSVoH TeOPubvhzDBiFT+/DnA4GPOYN8+H9zlFylJ8/pmk8Yusxrh2i7mIgNa9LGjWQPH46VA+ 2GIiRLzeZSZe3qxeDMJTzT3EHZU60It+mGTq5HsgFO+l0Qfmmi2razAOeTs9pUwnI6Gt Msgh3w3EgLQU01BoxVJ2AMtZNOYmyniuSUZqAmW3gcf9RKakvPyBrqfqhwUHc1OJD1y6 0hKf5Aqr0ruy4rccyKBrGFrq06v4ILCaq2k3j9bhM/X77O7G3Vhy7X1/ZIt72SQI5l5k hsjg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs3si2403944ejc.368.2021.08.04.04.12.25; Wed, 04 Aug 2021 04:12:48 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237625AbhHDKwN (ORCPT + 99 others); Wed, 4 Aug 2021 06:52:13 -0400 Received: from foss.arm.com ([217.140.110.172]:59158 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237593AbhHDKwM (ORCPT ); Wed, 4 Aug 2021 06:52:12 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 648A513A1; Wed, 4 Aug 2021 03:52:00 -0700 (PDT) Received: from [10.57.10.145] (unknown [10.57.10.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 843893F719; Wed, 4 Aug 2021 03:51:58 -0700 (PDT) Subject: Re: [PATCH v2] cpufreq: arm_scmi: Fix error path when allocation failed To: Viresh Kumar Cc: linux-kernel@vger.kernel.org, sudeep.holla@arm.com, cristian.marussi@arm.com, rjw@rjwysocki.net, nicola.mazzucato@arm.com, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org References: <20210803090744.12143-1-lukasz.luba@arm.com> <20210804040237.ssrba26jpe572mjf@vireshk-i7> From: Lukasz Luba Message-ID: Date: Wed, 4 Aug 2021 11:51:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20210804040237.ssrba26jpe572mjf@vireshk-i7> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/4/21 5:02 AM, Viresh Kumar wrote: > On 03-08-21, 10:07, Lukasz Luba wrote: >> Stop the initialization when cpumask allocation failed and return an >> error. >> >> Fixes: 80a064dbd556 ("scmi-cpufreq: Get opp_shared_cpus from opp-v2 for EM") >> Signed-off-by: Lukasz Luba >> --- >> changes: >> v2: >> - removed dev_warn() since it's not needed in this case >> - adjusted the patch description >> >> drivers/cpufreq/scmi-cpufreq.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c >> index ec9a87ca2dbb..75f818d04b48 100644 >> --- a/drivers/cpufreq/scmi-cpufreq.c >> +++ b/drivers/cpufreq/scmi-cpufreq.c >> @@ -134,7 +134,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) >> } >> >> if (!zalloc_cpumask_var(&opp_shared_cpus, GFP_KERNEL)) >> - ret = -ENOMEM; >> + return -ENOMEM; >> >> /* Obtain CPUs that share SCMI performance controls */ >> ret = scmi_get_sharing_cpus(cpu_dev, policy->cpus); > > Applied. Thanks. > Thank you for taking it.