RDMA/rtrs: Cleanup the code in rtrs_srv_rdma_cm_handler
authorGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Thu, 25 Mar 2021 15:32:56 +0000 (16:32 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 1 Apr 2021 18:40:43 +0000 (15:40 -0300)
Let these cases share the same path since all of them need to close
session.

Link: https://lore.kernel.org/r/20210325153308.1214057-11-gi-oh.kim@ionos.com
Signed-off-by: Guoqing Jiang <guoqing.jiang@ionos.com>
Reviewed-by: Danil Kipnis <danil.kipnis@ionos.com>
Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/ulp/rtrs/rtrs-srv.c

index 37ba121..9fe4ab1 100644 (file)
@@ -1908,13 +1908,10 @@ static int rtrs_srv_rdma_cm_handler(struct rdma_cm_id *cm_id,
        case RDMA_CM_EVENT_UNREACHABLE:
                rtrs_err(s, "CM error (CM event: %s, err: %d)\n",
                          rdma_event_msg(ev->event), ev->status);
-               close_sess(sess);
-               break;
+               fallthrough;
        case RDMA_CM_EVENT_DISCONNECTED:
        case RDMA_CM_EVENT_ADDR_CHANGE:
        case RDMA_CM_EVENT_TIMEWAIT_EXIT:
-               close_sess(sess);
-               break;
        case RDMA_CM_EVENT_DEVICE_REMOVAL:
                close_sess(sess);
                break;