Commit bbdfe5aa authored by Dan Carpenter's avatar Dan Carpenter Committed by Alex Deucher
Browse files

drm/amd/pm: fix error code in smu_set_power_limit()



We should return -EINVAL instead of success if the "limit" is too high.

Fixes: e098bc96 ("drm/amd/pm: optimize the power related source code layout")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 90cb3d8a
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -2221,6 +2221,7 @@ static int smu_set_power_limit(void *handle, uint32_t limit)
		dev_err(smu->adev->dev,
		dev_err(smu->adev->dev,
			"New power limit (%d) is over the max allowed %d\n",
			"New power limit (%d) is over the max allowed %d\n",
			limit, smu->max_power_limit);
			limit, smu->max_power_limit);
		ret = -EINVAL;
		goto out;
		goto out;
	}
	}