Re: [PATCH v2] drm/amd: fix potential memleak in err branch

2020-06-23 Thread Felix Kuehling
Am 2020-06-20 um 4:54 a.m. schrieb Bernard Zhao: > 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

[PATCH v2] drm/amd: fix potential memleak in err branch

2020-06-20 Thread Bernard Zhao
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