iw_cxgb4: remove the stid on listen create failure
authorSteve Wise <swise@opengridcomputing.com>
Tue, 5 Sep 2017 18:52:34 +0000 (11:52 -0700)
committerpopcornmix <popcornmix@gmail.com>
Fri, 6 Oct 2017 12:06:50 +0000 (13:06 +0100)
commit19103b04d3e64782804b42176b2a027ca5426b7a
tree107032c7ad674ea97e7491e5ab22d53f112e07bc
parent9846f57ef60b9b7e7ca13c7770520be735bbbc26
iw_cxgb4: remove the stid on listen create failure

commit 8b1bbf36b7452c4acb20e91948eaa5e225ea6978 upstream.

If a listen create fails, then the server tid (stid) is incorrectly left
in the stid idr table, which can cause a touch-after-free if the stid
is looked up and the already freed endpoint is touched.  So make sure
and remove it in the error path.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/cxgb4/cm.c