drm/amdkfd: Fix reference count leaks.
authorQiushi Wu <wu000273@umn.edu>
Sat, 13 Jun 2020 19:32:26 +0000 (14:32 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:16 +0000 (11:29 +0200)
commitd312f436dd10bfa2e8fba256fdcb7b1592230b9a
tree84c1d1d661a07d09b7278036b06184407a041ec0
parentb7850ba6edf0036596828ce540a8a376ea067aba
drm/amdkfd: Fix reference count leaks.

[ Upstream commit 20eca0123a35305e38b344d571cf32768854168c ]

kobject_init_and_add() takes reference even when it fails.
If this function returns an error, kobject_put() must be called to
properly clean up the memory associated with the object.

Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdkfd/kfd_topology.c