Commit c2efbc3f authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/pm: correct string parsing for extra separator characters case

Supplement of previous fix.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent aec1d870
...@@ -1870,6 +1870,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev, ...@@ -1870,6 +1870,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
memcpy(buf_cpy, buf, count-i); memcpy(buf_cpy, buf, count-i);
tmp_str = buf_cpy; tmp_str = buf_cpy;
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) { while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
if (strlen(sub_str) == 0)
continue;
ret = kstrtol(sub_str, 0, &parameter[parameter_size]); ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
if (ret) if (ret)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment