Skip to content
Commit eab09824 authored by Guoqing Jiang's avatar Guoqing Jiang Committed by Jason Gunthorpe
Browse files

RDMA/rtrs-clt: Refactor the failure cases in alloc_clt

Make all failure cases go to the common path to avoid duplicate code.
And some issued existed before.

1. clt need to be freed to avoid memory leak.

2. return ERR_PTR(-ENOMEM) if kobject_create_and_add fails, because
   rtrs_clt_open checks the return value of by call "IS_ERR(clt)".

Fixes: 6a98d71d ("RDMA/rtrs: client: main functionality")
Link: https://lore.kernel.org/r/20201217141915.56989-15-jinpu.wang@cloud.ionos.com


Signed-off-by: default avatarGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Reviewed-by: default avatarMd Haris Iqbal <haris.iqbal@cloud.ionos.com>
Signed-off-by: default avatarJack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 8537f2de
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment