]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
iw_cxgb4: drop listen destroy replies if no ep found
authorSteve Wise <swise@opengridcomputing.com>
Tue, 5 Sep 2017 18:52:33 +0000 (11:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2017 07:47:31 +0000 (09:47 +0200)
commit 3c8415cc7aff467faba25841fb859660ac14a04e upstream.

If the thread waiting for a CLOSE_LISTSRV_RPL times out and bails,
then we need to handle a subsequent CPL if it arrives and the stid has
been released.  In this case silently drop it.

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

index e49b34c3b1369d60d93d79fb0f22cc55e262ee5d..9ad7cd42e9a84767dccd57f73da26c532d80b81f 100644 (file)
@@ -2333,9 +2333,14 @@ static int close_listsrv_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
        unsigned int stid = GET_TID(rpl);
        struct c4iw_listen_ep *ep = get_ep_from_stid(dev, stid);
 
+       if (!ep) {
+               pr_debug("%s stid %d lookup failure!\n", __func__, stid);
+               goto out;
+       }
        pr_debug("%s ep %p\n", __func__, ep);
        c4iw_wake_up(&ep->com.wr_wait, status2errno(rpl->status));
        c4iw_put_ep(&ep->com);
+out:
        return 0;
 }