Commit 87004abf authored by Alex Deucher's avatar Alex Deucher

Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"

This regressed some working configurations so revert it.  Will
fix this properly for 5.9 and backport then.

This reverts commit 38e0c89a.
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent fde9f39a
...@@ -778,7 +778,8 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev, ...@@ -778,7 +778,8 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,
tmp_str++; tmp_str++;
while (isspace(*++tmp_str)); while (isspace(*++tmp_str));
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) { while (tmp_str[0]) {
sub_str = strsep(&tmp_str, delimiter);
ret = kstrtol(sub_str, 0, &parameter[parameter_size]); ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
if (ret) if (ret)
return -EINVAL; return -EINVAL;
...@@ -1038,7 +1039,8 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask) ...@@ -1038,7 +1039,8 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask)
memcpy(buf_cpy, buf, bytes); memcpy(buf_cpy, buf, bytes);
buf_cpy[bytes] = '\0'; buf_cpy[bytes] = '\0';
tmp = buf_cpy; tmp = buf_cpy;
while ((sub_str = strsep(&tmp, delimiter)) != NULL) { while (tmp[0]) {
sub_str = strsep(&tmp, delimiter);
if (strlen(sub_str)) { if (strlen(sub_str)) {
ret = kstrtol(sub_str, 0, &level); ret = kstrtol(sub_str, 0, &level);
if (ret) if (ret)
...@@ -1635,7 +1637,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev, ...@@ -1635,7 +1637,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
i++; i++;
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 (tmp_str[0]) {
sub_str = strsep(&tmp_str, delimiter);
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