Re: [PATCH v2] drm/amdgpu: Fix potential double free and null pointer dereference

2022-11-24 Thread Luben Tuikov
Applied. Regards, Luben On 2022-11-22 19:10, Luben Tuikov wrote: > amdgpu_xgmi_hive_type does provide a release method which frees the allocated > "hive", > so we don't need a kfree() after a kobject_put(). > > Reviewed-by: Luben Tuikov > > Regards, > Luben > > On 2022-11-21 23:28, Liang He

Re: [PATCH v2] drm/amdgpu: Fix potential double free and null pointer dereference

2022-11-22 Thread Luben Tuikov
amdgpu_xgmi_hive_type does provide a release method which frees the allocated "hive", so we don't need a kfree() after a kobject_put(). Reviewed-by: Luben Tuikov Regards, Luben On 2022-11-21 23:28, Liang He wrote: > In amdgpu_get_xgmi_hive(), we should not call kfree() after > kobject_put() as

[PATCH v2] drm/amdgpu: Fix potential double free and null pointer dereference

2022-11-21 Thread Liang He
In amdgpu_get_xgmi_hive(), we should not call kfree() after kobject_put() as the PUT will call kfree(). In amdgpu_device_ip_init(), we need to check the returned *hive* which can be NULL before we dereference it. Signed-off-by: Liang He --- v1->v2: we need the extra GET to keep *hive* alive, it