drm/amdkfd: Fix memory leaks according to error branches
Quoted 7 lines
The function
kobject_init_and_addalloc 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 addkobject_putinkobject_init_and_addfailed branch, fix potential memleak.
I suggest to improve this change description.
* Can an other wording variant be nicer?
* Will the tag “Fixes” become helpful?
Regards,
Markus