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)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 8 Oct 2017 01:09:36 +0000 (01:09 +0000)
commite9be437107893669fa9241497026dbe55a725ef3
tree9dced7238a3d0547ac30f66c588711f1f79884b3
parentddb57d3cc647d98f59ad3b1e4db098d26ac9ba2e
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