Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp692068pxu; Thu, 26 Nov 2020 09:11:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5GRxpMdKjPDZxZg2TPTuZfnoGWkiCGFXM+Fb0R2fDhyo5lWPJrLQNxXG65yPhtQQrZAKo X-Received: by 2002:a17:906:af6b:: with SMTP id os11mr3646306ejb.270.1606410684142; Thu, 26 Nov 2020 09:11:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606410684; cv=none; d=google.com; s=arc-20160816; b=PxLBj66PqUFwz8v3/UBt2f2+9hrougTARyqz9cydh9Hwer/hsQk1DZ/XcPvywAQvJ2 Q8OSSU//ASM6Q7kLLDY9QZrT5G0ZCDlSkHvV3cuoGR9Et32+/cdNeVzuNrvtixbqsM0U u9YFb2mXhA6d34cPE1qKdv0I0/0k+YGrE9odoZIR/ZZQZNNxWi097z0DbPAsWvK3djoO 1ozt2QoBSSGohGM9NARolRdUkUSctA9u1bA7/3elA3Nyn2hGK4wJ3v5+ngRbUlgSLMnv vdJ40xbgEE3pVcnLEwLlSZz+3V4rsuWZPlVSVBkIwNESbB19ibGSZg+oGOQ2yBxzUDq4 JbpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=lQiKxXJPBMu/PrWo9eRuof5ZeEL0++jnroD0J4EB9xg=; b=ElXzqQtJt+8b0VctPC89wu2xKI+0LaJYfiZpVl2e9DTyRGYg8tpeen71bS7K5JD2Jh eEmnjZwsnz2YTwKDMXM2d5Y9QvaPXUq1owj0O1fkvVPNjydmCb4EkNczWSad3AcR6p/8 wGtzdAw2JoJwdZPwEJzgj6I6ljD5My45znPj/UGZuJO2ThWMUR6DV2kujuwNq2hdlWkX M8Nk/7MWRSBtz1N+WD3Hx0cUnpcEO9bjOf4LRo7QE9hUo1AlU1aT01zUJpRbBo69whtV CWDWfpInvCw9DZjlveKVcle2H37f5rlXXBSs4Z6MQ/jCUGLJbp4HHa7OEop1aJM2f5x+ I8FA== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si3483383edq.407.2020.11.26.09.11.01; Thu, 26 Nov 2020 09:11:24 -0800 (PST) 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403901AbgKZRJQ (ORCPT + 99 others); Thu, 26 Nov 2020 12:09:16 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:34082 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391620AbgKZRJQ (ORCPT ); Thu, 26 Nov 2020 12:09:16 -0500 Received: by mail-oi1-f195.google.com with SMTP id s18so2984007oih.1; Thu, 26 Nov 2020 09:09:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lQiKxXJPBMu/PrWo9eRuof5ZeEL0++jnroD0J4EB9xg=; b=ItoJMMgsAwWAC/hBeA9Mj4QK/AKtL7S8HEhb3oYkh6CXf1Cy2FX23hh+MtwL8gfK34 NjKkOB5MlQKSlglMb32tbMJWsDNmd4O6rohzQL6maDDRV08I1KCSKAjNV8UGaPzsilx3 Zi+VhiRYnbRt4kKc++rMiYoQ2Zmt5T7bW1J+6BR7TtfUMncwclX656xL5W3Gnhnj/BZn 53/uzRMAHb8MMGE2VCBjMxFhVxUvxIN2nR89czaEcOxvZ9rMzHMQ9n+p6BqkbeHRM2Fz F+SnA41M+VIi/dq4TLmG8jE/5LIw4HJjpJm/YQPZ4mOvKjiEDjjeKv7HW9knWN25Dh5M qiHQ== X-Gm-Message-State: AOAM5302c41rauNWJC6MWt5Al0ebG359yze2gt2sY0MGutajhYAvTvqd uIHwpwaW3GVt09uw5yAtGVNKKh2sgw5i8oeFksw= X-Received: by 2002:aca:5a42:: with SMTP id o63mr2564525oib.69.1606410554408; Thu, 26 Nov 2020 09:09:14 -0800 (PST) MIME-Version: 1.0 References: <20201126011239.42294-1-bobo.shaobowang@huawei.com> In-Reply-To: <20201126011239.42294-1-bobo.shaobowang@huawei.com> From: "Rafael J. Wysocki" Date: Thu, 26 Nov 2020 18:09:03 +0100 Message-ID: Subject: Re: [PATCH v2] cpufreq: Fix error return code in cpufreq_online() To: Wang ShaoBo Cc: "Rafael J. Wysocki" , Viresh Kumar , Linux PM , Linux Kernel Mailing List , huawei.libin@huawei.com, cj.chengjian@huawei.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 26, 2020 at 2:12 AM Wang ShaoBo wrote: > > Fix to return proper error code instead of 0 in cpufreq_online(), as done > elsewhere in this function. > > Signed-off-by: Wang ShaoBo > --- > drivers/cpufreq/cpufreq.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 1e7e3f2ff09f..d3a28de35593 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -1391,8 +1391,10 @@ static int cpufreq_online(unsigned int cpu) > > policy->min_freq_req = kzalloc(2 * sizeof(*policy->min_freq_req), > GFP_KERNEL); > - if (!policy->min_freq_req) > + if (!policy->min_freq_req) { > + ret = -ENOMEM; > goto out_destroy_policy; > + } > > ret = freq_qos_add_request(&policy->constraints, > policy->min_freq_req, FREQ_QOS_MIN, > @@ -1429,6 +1431,7 @@ static int cpufreq_online(unsigned int cpu) > if (cpufreq_driver->get && has_target()) { > policy->cur = cpufreq_driver->get(policy->cpu); > if (!policy->cur) { > + ret = -EIO; > pr_err("%s: ->get() failed\n", __func__); > goto out_destroy_policy; > } > -- Applied as 5.11 material with a modified subject and some changelog edits, thanks!