Re: [PATCH] drm/amd/pm: correct string parsing for extra separator characters case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 21, 2021 at 3:41 AM Evan Quan <evan.quan@xxxxxxx> 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@xxxxxxx>

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

> ---
>  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@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux