All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/pm: correct string parsing for extra separator characters case
@ 2021-01-21  8:41 Evan Quan
  2021-01-22 23:12 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Evan Quan @ 2021-01-21  8:41 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Evan Quan

Supplement of previous fix "2d873f24dfaf drm/amdgpu/pm: Account for extra
separator characters in sysfs interface".

Change-Id: Ie9e9a78ad8530ba4b46ea27e28559d5dcda5c033
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index ba1539f6e0ce..ac150e63dd25 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -1866,6 +1866,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;
-- 
2.29.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amd/pm: correct string parsing for extra separator characters case
  2021-01-21  8:41 [PATCH] drm/amd/pm: correct string parsing for extra separator characters case Evan Quan
@ 2021-01-22 23:12 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2021-01-22 23:12 UTC (permalink / raw)
  To: Evan Quan; +Cc: Deucher, Alexander, amd-gfx list

On Thu, Jan 21, 2021 at 3:41 AM Evan Quan <evan.quan@amd.com> wrote:
>
> Supplement of previous fix "2d873f24dfaf drm/amdgpu/pm: Account for extra
> separator characters in sysfs interface".
>
> Change-Id: Ie9e9a78ad8530ba4b46ea27e28559d5dcda5c033
> Signed-off-by: Evan Quan <evan.quan@amd.com>

Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> index ba1539f6e0ce..ac150e63dd25 100644
> --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> @@ -1866,6 +1866,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;
> --
> 2.29.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-22 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21  8:41 [PATCH] drm/amd/pm: correct string parsing for extra separator characters case Evan Quan
2021-01-22 23:12 ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.