linux/drivers/infiniband/hw
Kaike Wan a35cd6447e 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: f931551baf ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters")
Link: https://lore.kernel.org/r/20200512031328.189865.48627.stgit@awfm-01.aw.intel.com
Cc: <stable@vger.kernel.org>
Suggested-by: Lin Yi <teroincn@gmail.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>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2020-05-19 20:58:03 -03:00
..
bnxt_re RDMA/bnxt_re: make bnxt_re_ib_init static 2020-03-30 15:03:19 -03:00
cxgb4 RDMA/iw_cxgb4: Fix incorrect function parameters 2020-05-12 11:47:48 -03:00
efa RDMA/efa: Use in-kernel offsetofend() to check field availability 2020-03-18 21:06:37 -03:00
hfi1 IB/hfi1: Fix another case where pq is left on waitlist 2020-05-12 11:47:48 -03:00
hns RDMA/hns: Fix uninitialized variable bug 2020-03-29 11:09:55 -03:00
i40iw IB/i40iw: Remove bogus call to netdev_master_upper_dev_get() 2020-05-12 11:47:48 -03:00
mlx4 IB/mlx4: Test return value of calls to ib_get_cached_pkey 2020-05-12 11:47:48 -03:00
mlx5 RDMA/mlx5: Set GRH fields in query QP on RoCE 2020-04-22 15:43:46 -03:00
mthca RDMA/providers: Fix return value when QP type isn't supported 2020-03-04 12:13:42 -04:00
ocrdma RDMA/providers: Fix return value when QP type isn't supported 2020-03-04 12:13:42 -04:00
qedr RDMA/providers: Fix return value when QP type isn't supported 2020-03-04 12:13:42 -04:00
qib IB/qib: Call kobject_put() when kobject_init_and_add() fails 2020-05-19 20:58:03 -03:00
usnic RDMA/providers: Fix return value when QP type isn't supported 2020-03-04 12:13:42 -04:00
vmw_pvrdma RDMA/providers: Fix return value when QP type isn't supported 2020-03-04 12:13:42 -04:00
Makefile RDMA/iw_cxgb3: Remove the iw_cxgb3 module from kernel 2019-10-04 15:08:59 -03:00