Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2372519lqp; Sun, 24 Mar 2024 16:22:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUZa79xbNivKrHheRz0VqNigSaMMOSonfYWkUYJqmH3QgWz54hOb/Uizj9g7pGprEw9vmDCV0uJKi4WDbojLw2vEPdjxCPkc8taFWzpmw== X-Google-Smtp-Source: AGHT+IFMcf/iHqguyFX6MUlOmCE2oXdbw80Ek2EKaIxLjPApLuk8DTJxYbo9tVpWLbW9Lkt/1wkx X-Received: by 2002:a17:902:f70b:b0:1dd:779d:dd4a with SMTP id h11-20020a170902f70b00b001dd779ddd4amr6808496plo.63.1711322525208; Sun, 24 Mar 2024 16:22:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711322525; cv=pass; d=google.com; s=arc-20160816; b=Zql3X4h8xCTU2M5B2OcT7X1G+JssEJ3inefNACjejMW1wNjuBqMm9+HkGj9BZ3S5qB TfgY4X29pM7HZ2Qp4M84ztzYNLKdxO5eA+Jv7iLrNIjlVr+ViZC68+Ew6FjNvlnI2qwV trtnySINax2gQvFzYG2bbO3ABQfSv7LMrBV9SYBZCkjgcIDybxh890/yBBm6s7sTPyUk 7h1dcYTco1cN36CHGqgft3YAl71HNsc1zCn9wzB3Qa58NZtsw5jBU6HPqyPSAQFur6BK XfNLgEhRzM2gjzh38JkTd0pyEXu1zBYoZ6Bckkv2NNSiiSJGGpzLT89j8mu4mO3Vi4Co nxdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Tkan0aOlz4hHw420yIXG/7TN7E//iJnC84mMec4v5LA=; fh=xBeq4AytFH82+QG5rsBK2pd0Oxlh95Ju/nJEmuqnwfQ=; b=xsViN4krJGKC5IuMK71hJzFAWhLEVNCJfkxgDUndbDDf6UIMKQ+3B3vwQmcT2njQ1b xrdSoo23MYjUESaKeo7Uh+vNN9Suh7cv9bjJhhHk3V5TRb9XM1VhVdthX23dPxD0nD6U iSJMLuN8yt95gDLuHg9WYuYvd5P9Q75OELL4z1i5SF+0Lb/hPhweTMsuw4x6wMRaKQ5B 58xTtrbxSRwRpZj60HItTnS8GNp9F8PuEouUh7PiO3h4mfDVXCHP+SRBKn1tK7HWxi70 vYzacWAFNrjPJfJgUShhiDH0Eemsj3ndqomD1w8peZDgH0tTcwW5N7GAwgSOobOX9lYQ /iKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EiRPpfp+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113102-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s9-20020a17090330c900b001ddcd35060dsi3826008plc.260.2024.03.24.16.22.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:22:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EiRPpfp+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113102-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D09ED28814B for ; Sun, 24 Mar 2024 23:22:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C9AE15696E; Sun, 24 Mar 2024 22:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EiRPpfp+" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 447BB15530F; Sun, 24 Mar 2024 22:38:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319910; cv=none; b=doTcro/jsOriSIj9RIohir6XPqKmNizd0xK8DHOSUQcYpB7A0Hj7B7yj8n9a3HdLh9Snt4H2/dYxfy/X6n+nD8rBI5L3QqgMh5bfNrs1nK6t+Rl4+B3N1hiE6Yk2zECwwBhId5bLgnVmJJaJKZTEm2KxiByMUcuswcL/ZiWBWPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319910; c=relaxed/simple; bh=OC6s1nGnzvG27cdhEV9v+152Ge649GD6EUnGf7Ba9Jc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UHJ453o1MI7JkBe9gwOnWPBVs3pMHS2/MHf4CNXIeqDzSLr9FJ5LjE891IqKrhLWuMwotKMB/xuU61XmpATSyOlD9LBvnhaJa/zuIgjLkzGKMvCeFFfk7hyuk9GDha4Qa74XIcSu3y0cakQh2FNiWECdFFLxNv5oFBNLiHWn3Ds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EiRPpfp+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B386C433F1; Sun, 24 Mar 2024 22:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319909; bh=OC6s1nGnzvG27cdhEV9v+152Ge649GD6EUnGf7Ba9Jc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EiRPpfp+kpzLZ3NwyrkyMij71Ny6Eq4ga9Mwhvvf0Tbxr2nrCe7hGDKFP24xTB/db +7I/W/wq8PyUq1roK9FxWpyskCeLldYhxm3FiAwwg7uH931rYEte0YxxbkBk4WEy8e izrWcgIEvzPJMpisvDa7NjxKzNXOS+PYHJARBk6/TghLZ9CBKvUrOyuv/dUkslkWHN nRkWfMJW9Rg2Oxq4beibr6hh9Le3fikd+aj6oVPWAFx3vmvghAXa5dCxm0gD/Jq9pV Al+aWFfkK1FoAghAuUdiSnbheaNUe4mHYQFAD85aDfcZT8ycx98GCHvwgzWvSfPnfE FboJuyDszODsQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Daniel Lezcano , "Rafael J . Wysocki" , Sasha Levin Subject: [PATCH 6.8 215/715] powercap: dtpm_cpu: Fix error check against freq_qos_add_request() Date: Sun, 24 Mar 2024 18:26:34 -0400 Message-ID: <20240324223455.1342824-216-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Daniel Lezcano [ Upstream commit b50155cb0d609437236c88201206267835c6f965 ] The caller of the function freq_qos_add_request() checks again a non zero value but freq_qos_add_request() can return '1' if the request already exists. Therefore, the setup function fails while the QoS request actually did not failed. Fix that by changing the check against a negative value like all the other callers of the function. Fixes: 0e8f68d7f0485 ("Add CPU energy model based support") Signed-off-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/powercap/dtpm_cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c index 9193c3b8edebe..ae7ee611978ba 100644 --- a/drivers/powercap/dtpm_cpu.c +++ b/drivers/powercap/dtpm_cpu.c @@ -219,7 +219,7 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent) ret = freq_qos_add_request(&policy->constraints, &dtpm_cpu->qos_req, FREQ_QOS_MAX, pd->table[pd->nr_perf_states - 1].frequency); - if (ret) + if (ret < 0) goto out_dtpm_unregister; cpufreq_cpu_put(policy); -- 2.43.0