Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4627256pxj; Wed, 12 May 2021 09:32:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNlngq0Egq1ewoBr2qIvs7i9fMUB4pBiZCiesgHckdL3PUpkCyoyUj+jyfJ5v9X/PntpIm X-Received: by 2002:ac2:53a1:: with SMTP id j1mr24739593lfh.337.1620837150847; Wed, 12 May 2021 09:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837150; cv=none; d=google.com; s=arc-20160816; b=cthQHCc6xcNYFSEyMex/J4fXtIMXGboUN/rPT3rmz6bW5kduUPWa6r7+hYlP/geYED Mkl6u1Vdn+UIqjXzJGLEC54vzcvMHlpWzfzovoLA/p87wF5RD+hkjrLt1+BP0LoMetYm oCqAuXmOcOcaIaA2lKuiTXxHvaVHQOS7qD3yV7fH5+SDfpSYMCvrynFuL4ujgkbp55Fv iqizQ5f+ZDSk/O3sn/8WWllDGazBz6dN0zQ20s4XKDSK9wbKHi9QKqUi849FBs9sneBc OLW+33a7CjXnNRsFL8q56VaFctx6rc9z7OvY5E+8CJ9qODErmu10uxsuiaLrZOdEtEGU DlBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vv+WAUNJ/cpABNO3wXpAd66H63WgiorxloIi5C8fLFY=; b=mU1jLjByS1QKQuUqJc5hlDS30gQE4o1uIC/RFwPV1tOuC7dGOHXeIHs5sIiv+e+3jU BcrRCHfViNaCSIAvq40TYY99PptqeHrbRS0RtA5vHFV0nUKtuFOeCtsztqR+u7qym+SD RllOs9FF4RYDkz3ygxwIA7mlE8URC9iER/tVloLYiDVnmyucXBEu4VVuwDNbcZMWmhAm bc28wwT1X87nV5tamKNxdsw5a1QFp2buN+Qyv3FzgF8kDAPHrZJcjPUorNTZgEPBxPri z8X62AHELwU4L+xVIM782ME978r/uabjhdkt19HkQJPO8kQws6HbeHXB/RBG7tO2PjyJ QHJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1ak/DNvK"; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si542587lfa.255.2021.05.12.09.32.01; Wed, 12 May 2021 09:32:30 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1ak/DNvK"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241917AbhELQbI (ORCPT + 99 others); Wed, 12 May 2021 12:31:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:35404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236152AbhELPkX (ORCPT ); Wed, 12 May 2021 11:40:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 987C061C80; Wed, 12 May 2021 15:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832859; bh=aJwLh03l/S/cg/+47Syo3T48YlqwqLcbcCZvP/yyZHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1ak/DNvKQwFmZTXy1DffTQt6ylH8F68Wbt/+4GJpBFQzeZnz0xmXBv56DQzl7GAUR WAROIoJW8He2LnI6ybO4OnL+BL+IK+YL9hTOA/bbI0YzlQpb4sZpbSl91O0lVaLQXK 7ZMoqpVVXT0O4yGo/CUSSPA+m0yhJHFguFFgoLXg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Alex Deucher , Sasha Levin Subject: [PATCH 5.10 453/530] drm/amd/pm: fix error code in smu_set_power_limit() Date: Wed, 12 May 2021 16:49:23 +0200 Message-Id: <20210512144834.657553332@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit bbdfe5aaef3c1d5c5e62fa235ef13f064e4c1c17 ] We should return -EINVAL instead of success if the "limit" is too high. Fixes: e098bc9612c2 ("drm/amd/pm: optimize the power related source code layout") Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 5cc45b1cff7e..e5893218fa4b 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -2001,6 +2001,7 @@ int smu_set_power_limit(struct smu_context *smu, uint32_t limit) dev_err(smu->adev->dev, "New power limit (%d) is over the max allowed %d\n", limit, smu->max_power_limit); + ret = -EINVAL; goto out; } -- 2.30.2