IB/srpt: Fix srpt_cm_req_recv() error path (1/2)
authorBart Van Assche <bart.vanassche@wdc.com>
Tue, 10 Jul 2018 17:31:58 +0000 (10:31 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 13 Jul 2018 17:55:32 +0000 (11:55 -0600)
commit847462de3a0aabc5343a1e338537f69a03bb61af
treed27b446d72051a69436a1feb99cc6613a8a37a69
parent05f58ceba123bdb420cf44c6ea04b6db467edd1c
IB/srpt: Fix srpt_cm_req_recv() error path (1/2)

Once a target session has been allocated, if an error occurs, the session
must be freed. Since it is not safe to call blocking code from the context
of an connection manager callback, trigger target session release in this
case by calling srpt_close_ch().

Fixes: db7683d7deb2 ("IB/srpt: Fix login-related race conditions")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/ulp/srpt/ib_srpt.c