summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/pm/amdgpu_pm.c
diff options
context:
space:
mode:
authorEvan Quan <evan.quan@amd.com>2021-01-21 16:24:02 +0800
committerAlex Deucher <alexander.deucher@amd.com>2021-02-01 11:51:46 -0500
commitc2efbc3f9dbef72054d85913135fae7f99ad6b25 (patch)
tree976917165206addd24531f3841f38ae99cee17a5 /drivers/gpu/drm/amd/pm/amdgpu_pm.c
parentaec1d8703e02426cc2cda618e4d79aa618858298 (diff)
drm/amd/pm: correct string parsing for extra separator characters case
Supplement of previous fix. Signed-off-by: Evan Quan <evan.quan@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/amdgpu_pm.c')
-rw-r--r--drivers/gpu/drm/amd/pm/amdgpu_pm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index bbfb9668072a..0d37c849b686 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -1870,6 +1870,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
memcpy(buf_cpy, buf, count-i);
tmp_str = buf_cpy;
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
+ if (strlen(sub_str) == 0)
+ continue;
ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
if (ret)
return -EINVAL;