diff options
| author | Evan Quan <[email protected]> | 2021-01-21 08:24:02 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2021-02-01 16:51:46 +0000 |
| commit | c2efbc3f9dbef72054d85913135fae7f99ad6b25 (patch) | |
| tree | 976917165206addd24531f3841f38ae99cee17a5 /drivers/gpu/drm/amd/pm/amdgpu_pm.c | |
| parent | drm/amdgpu/pm: Account for extra separator characters in sysfs interface (diff) | |
| download | kernel-c2efbc3f9dbef72054d85913135fae7f99ad6b25.tar.gz kernel-c2efbc3f9dbef72054d85913135fae7f99ad6b25.zip | |
drm/amd/pm: correct string parsing for extra separator characters case
Supplement of previous fix.
Signed-off-by: Evan Quan <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/amdgpu_pm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 |
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, ¶meter[parameter_size]); if (ret) return -EINVAL; |
