projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c08770e
)
drm/amd/amdgpu: Fix memleak in cz_parse_power_table()
author
Tom St Denis
<
[email protected]
>
Thu, 25 Aug 2016 16:16:24 +0000
(12:16 -0400)
committer
Alex Deucher
<
[email protected]
>
Thu, 25 Aug 2016 18:02:39 +0000
(14:02 -0400)
If one of the entries fails to be allocated then free
all of the previous entries before freeing the array which
holds their pointers.
Signed-off-by: Tom St Denis <
[email protected]
>
Reviewed-by: Alex Deucher <
[email protected]
>
Signed-off-by: Alex Deucher <
[email protected]
>
drivers/gpu/drm/amd/amdgpu/cz_dpm.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
index 794c5f36ca68f8c04adf69d87bdf437565a869a7..9c2ab73a7ae3520d49744f72fc1b5a8475d7dfd4 100644
(file)
--- a/
drivers/gpu/drm/amd/amdgpu/cz_dpm.c
+++ b/
drivers/gpu/drm/amd/amdgpu/cz_dpm.c
@@
-350,6
+350,8
@@
static int cz_parse_power_table(struct amdgpu_device *adev)
ps = kzalloc(sizeof(struct cz_ps), GFP_KERNEL);
if (ps == NULL) {
+ for (j = 0; j < i; j++)
+ kfree(adev->pm.dpm.ps[j].ps_priv);
kfree(adev->pm.dpm.ps);
return -ENOMEM;
}