iser-target: Fix possible use-after-free in connection establishment error
authorSagi Grimberg <sagi@grimberg.me>
Sun, 26 Nov 2017 13:31:04 +0000 (15:31 +0200)
committerDoug Ledford <dledford@redhat.com>
Wed, 10 Jan 2018 21:46:03 +0000 (16:46 -0500)
commitcd52cb26e7ead5093635e98e07e221e4df482d34
treef62ae4a0d8842b51f6b305c6a5ac3dcf7034e21d
parenta1ffa4670cb97ae3a4b3e8535d88be5f643f7c3b
iser-target: Fix possible use-after-free in connection establishment error

In case we fail to establish the connection we must drain our pre-posted
login recieve work request before continuing safely with connection
teardown.

Fixes: a060b5629ab0 ("IB/core: generic RDMA READ/WRITE API")
Cc: <stable@vger.kernel.org> # 4.7+
Reported-by: Amrani, Ram <Ram.Amrani@cavium.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/isert/ib_isert.c