RDMA/rtrs: Call kobject_put in the failure path
authorGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Thu, 17 Dec 2020 14:19:03 +0000 (15:19 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 15 Jan 2021 19:25:09 +0000 (15:25 -0400)
commit424774c9f3fa100ef7d9cfb9ee211e2ba1cd5119
treefced172582c2b5d4b221ad8190575885f1e5f9e0
parentf77c4839ee8f4612dcb6601602329096030bd813
RDMA/rtrs: Call kobject_put in the failure path

Per the comment of kobject_init_and_add, we need to free the memory
by call kobject_put.

Fixes: 215378b838df ("RDMA/rtrs: client: sysfs interface functions")
Fixes: 91b11610af8d ("RDMA/rtrs: server: sysfs interface functions")
Link: https://lore.kernel.org/r/20201217141915.56989-8-jinpu.wang@cloud.ionos.com
Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Reviewed-by: Md Haris Iqbal <haris.iqbal@cloud.ionos.com>
Reviewed-by: Gioh Kim <gi-oh.kim@cloud.ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c
drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c