Skip to content

Instantly share code, notes, and snippets.

@shimarin
Created August 2, 2020 03:34
Show Gist options
  • Save shimarin/0b64f622e22b983ec014de6088bef1ed to your computer and use it in GitHub Desktop.
Save shimarin/0b64f622e22b983ec014de6088bef1ed to your computer and use it in GitHub Desktop.
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c 2020-07-23 13:58:14.392337637 +0900
+++ a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c 2020-08-02 12:26:10.677578297 +0900
@@ -775,14 +775,15 @@
tmp_str++;
while (isspace(*++tmp_str));
- while (tmp_str[0]) {
- sub_str = strsep(&tmp_str, delimiter);
+ while (tmp_str[0] && (sub_str = strsep(&tmp_str, delimiter)) != NULL) {
ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
if (ret)
return -EINVAL;
parameter_size++;
- while (isspace(*tmp_str))
+ if (tmp_str == NULL) break;
+
+ while (*tmp_str && isspace(*tmp_str))
tmp_str++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment