diff options
| author | Kaike Wan <[email protected]> | 2020-05-12 03:13:28 +0000 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2020-05-19 23:58:03 +0000 |
| commit | a35cd6447effd5c239b564c80fa109d05ff3d114 (patch) | |
| tree | 9caacdf383d6ced0c078dc02a20a385c340873d6 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
| parent | Linux 5.7-rc6 (diff) | |
| download | kernel-a35cd6447effd5c239b564c80fa109d05ff3d114.tar.gz kernel-a35cd6447effd5c239b564c80fa109d05ff3d114.zip | |
IB/qib: Call kobject_put() when kobject_init_and_add() fails
When kobject_init_and_add() returns an error in the function
qib_create_port_files(), the function kobject_put() is not called for the
corresponding kobject, which potentially leads to memory leak.
This patch fixes the issue by calling kobject_put() even if
kobject_init_and_add() fails. In addition, the ppd->diagc_kobj is released
along with other kobjects when the sysfs is unregistered.
Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters")
Link: https://lore.kernel.org/r/[email protected]
Cc: <[email protected]>
Suggested-by: Lin Yi <[email protected]>
Reviewed-by: Mike Marciniszyn <[email protected]>
Signed-off-by: Kaike Wan <[email protected]>
Signed-off-by: Dennis Dalessandro <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
0 files changed, 0 insertions, 0 deletions
