diff options
author | Bernard Zhao <[email protected]> | 2020-06-20 17:11:52 +0800 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2020-06-24 18:03:16 -0400 |
commit | b5b78a6c8d8cb9c307bc6b16a754603424459d6e (patch) | |
tree | 277265b11f11cb3ddb6e86e40542299c1a30f721 /lib/test-string_helpers.c | |
parent | fa7041d9d2fc7401cece43f305eb5b87b7017fc4 (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]>
Cc: [email protected]
Diffstat (limited to 'lib/test-string_helpers.c')
0 files changed, 0 insertions, 0 deletions