linux/drivers/infiniband
Kaike Wan dfb5394f80 IB/hfi1: Call kobject_put() when kobject_init_and_add() fails
When kobject_init_and_add() returns an error in the function
hfi1_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.

Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200326163813.21129.44280.stgit@awfm-01.aw.intel.com
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2020-03-27 13:13:36 -03:00
..
core RDMA/cm: Update num_paths in cma_resolve_iboe_route error flow 2020-03-26 14:43:12 -03:00
hw IB/hfi1: Call kobject_put() when kobject_init_and_add() fails 2020-03-27 13:13:36 -03:00
sw RDMA/rxe: Set sys_image_guid to be aligned with HW IB devices 2020-03-26 16:45:29 -03:00
ulp IB/hfi1: Get rid of a warning 2020-03-27 12:51:04 -03:00
Kconfig RDMA/iw_cxgb3: Remove the iw_cxgb3 module from kernel 2019-10-04 15:08:59 -03:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00