Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5411611rwl; Mon, 3 Apr 2023 20:31:07 -0700 (PDT) X-Google-Smtp-Source: AKy350Ydim1nV6rFbdiGbaor0XmXiuPYW2bAvgBNb3sqjaZdIBXxL6zQn39ie1nKO40fNTXHyhvb X-Received: by 2002:a05:6402:50f:b0:4af:69b8:52af with SMTP id m15-20020a056402050f00b004af69b852afmr1129630edv.24.1680579067564; Mon, 03 Apr 2023 20:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680579067; cv=none; d=google.com; s=arc-20160816; b=TDaGsoNg5RnRPoapMxc1uEARQL/j9ocgZTaOzwa2K0tyuEqEqGaCl4jFVaFtH79EUb gjlULsmNoIYpJxH3aucjah5PNwgpVfYZGrt59ANvavSZKiNuKc1iCM3qFD2bH8Pabq03 omhAO06qJ3HtolXbPQO064mIRF8iHIoPQfU2tKgVpYmbzObx7cu6nnnYDm0YMegwmsV2 x/pRCuxDnjxFvJgQbAPpKD7ROeF+fbKM3k0BW+SGcYyVIVCmHgPRW/UmMQoMJn97IHWB qaMVhO/q+Sr10EpH2yZCo9Ubsbg6EfVu6vHpcTdgZhk+lOM28K9PHb69uehfNJmLQVM6 +kxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:cc:to:subject:message-id :from:content-transfer-encoding:date:dkim-signature:mime-version; bh=h2jWPezVO29/X7/c6BGQ5cVlKWQV5b6jUODU7F71l8g=; b=UC9N6b5HO/6MuEPB5qs/Htt1jqucybvRgs7BnL5Md7LfRF18h/h3sO2IuhDJr1D+ti AQ4j5gKN05PQerDN4iYU9I2Vxwr+nW03ok7ns8Xs1/+/TnGSq9adddJpm4zYJPf6X2Tb yN0mTqC2J4X4Fo6EC4wdyRihtK2JNgnLAqHNJswN4AZuR2HYWZCBg8Gd+VXtteosQFtY N6wwLx41RgighQI59lYqm6Xiu+UrxsHB6zgfH3N4N67SPkFq+3wlWaCn+E/RDao0X+9O UmZv0vSHGykg0CBEzQO42ThK1lgb+8yZYuo05xloE/4vogoun+Me+Cz+4sZU8t8KybMP RCqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=a8IcIEN7; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020a50fa85000000b004c1190b5abbsi1145860edr.184.2023.04.03.20.30.40; Mon, 03 Apr 2023 20:31:07 -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=@linux.dev header.s=key1 header.b=a8IcIEN7; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232723AbjDDDIp (ORCPT + 99 others); Mon, 3 Apr 2023 23:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231546AbjDDDIn (ORCPT ); Mon, 3 Apr 2023 23:08:43 -0400 Received: from out-53.mta1.migadu.com (out-53.mta1.migadu.com [95.215.58.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 683301705 for ; Mon, 3 Apr 2023 20:08:39 -0700 (PDT) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1680577717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h2jWPezVO29/X7/c6BGQ5cVlKWQV5b6jUODU7F71l8g=; b=a8IcIEN7PmetPwAyDfihSGSTRo8CZoaaswAyktN+U/ZI87qi43VEdkEjA+wWSEGyLG9Cgc nZsQ5LbapVAiscw+UDxP/5dccH/+j3jBFAzFwtD8Th+/n+P9TSLdcpkVa48qCV3H7RhQyh Q6gKgeS/YD4HPHxFGp69ADhcSFyjUaw= Date: Tue, 04 Apr 2023 03:08:30 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Yajun Deng" Message-ID: Subject: Re: [PATCH] cpufreq: Fix policy->freq_table is NULL in __cpufreq_driver_target() To: "Viresh Kumar" Cc: rafael@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230403041128.jrsvbm4ddxdyhddg@vireshk-i7> References: <20230403041128.jrsvbm4ddxdyhddg@vireshk-i7> <20230329133600.908723-1-yajun.deng@linux.dev> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 April 3, 2023 12:11 PM, "Viresh Kumar" wrote:= =0A=0A> On 29-03-23, 21:36, Yajun Deng wrote:=0A> =0A>> __resolve_freq() = may be return target_freq if policy->freq_table is=0A>> NULL. In this cas= e, it should return -EINVAL before __target_index().=0A>> =0A>> Signed-of= f-by: Yajun Deng =0A>> ---=0A>> drivers/cpufreq/cpu= freq.c | 2 +-=0A>> 1 file changed, 1 insertion(+), 1 deletion(-)=0A>> =0A= >> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c=0A>= > index c0e5be0fe2d6..308a3df1a940 100644=0A>> --- a/drivers/cpufreq/cpuf= req.c=0A>> +++ b/drivers/cpufreq/cpufreq.c=0A>> @@ -2299,7 +2299,7 @@ int= __cpufreq_driver_target(struct cpufreq_policy *policy,=0A>> return cpufr= eq_driver->target(policy, target_freq, relation);=0A>> }=0A>> =0A>> - if = (!cpufreq_driver->target_index)=0A>> + if (!cpufreq_driver->target_index = || !policy->freq_table)=0A>> return -EINVAL;=0A> =0A> Hi,=0A> =0A> I have= sent an alternate patch [1] for this, please try it.=0A>=0A =0AThanks, v= 2 is fine.=0A=0A> --=0A> viresh=0A> =0A> [1]=0A> https://lore.kernel.org/= all/53d4ed4e5b18a59a48790434f8146fb207e11c49.1680494945.git.viresh.kumar@= lin=0A> ro.org