aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorBernard Zhao <[email protected]>2020-06-20 17:11:52 +0800
committerAlex Deucher <[email protected]>2020-07-01 01:59:26 -0400
commitdc2f832ecb045dd43793531ae149e1767696f5ad (patch)
tree45b5267655b057b730b0335c059dc243cfb260ce /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parentf29aa08852e1953e461f2d47ab13c34e14bc08b3 (diff)
drm/amd: fix potential memleak in err branch
The function kobject_init_and_add alloc memory like: kobject_init_and_add->kobject_add_varg->kobject_set_name_vargs ->kvasprintf_const->kstrdup_const->kstrdup->kmalloc_track_caller ->kmalloc_slab, in err branch this memory not free. If use kmemleak, this path maybe catched. These changes are to add kobject_put in kobject_init_and_add failed branch, fix potential memleak. Signed-off-by: Bernard Zhao <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
0 files changed, 0 insertions, 0 deletions