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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2017 07:44:02 +0000 (09:44 +0200)
commitf184cf5256b704c41acb873575cd2a554bfe4265
treecd222e7dfe52a6be24286e6d23fda78415309261
parenteb4375e1969c48d454998b2a284c2e6a5dc9eb68
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