IB/rxe: Fix up rxe_qp_cleanup()
authorAndrew Boyer <andrew.boyer@dell.com>
Mon, 28 Aug 2017 20:11:55 +0000 (16:11 -0400)
committerDoug Ledford <dledford@redhat.com>
Mon, 28 Aug 2017 23:12:34 +0000 (19:12 -0400)
Replace sk_dst_get()/dst_release() in rxe_qp_cleanup() with sk_dst_reset().
sk_dst_get() takes a new reference on dst, so the dst_release() doesn't
actually release the original reference, which was the design intent.

Fixes: 4ed6ad1eb30e ("IB/rxe: Cache dst in QP instead of getting it...")
Signed-off-by: Andrew Boyer <andrew.boyer@dell.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_qp.c

index 80ccc7c7c3412b7bdb03b3d877eb23c2d09cca31..00bda9380a2e4589c23e21b2a96ecaa2f4719ef9 100644 (file)
@@ -851,13 +851,8 @@ void rxe_qp_cleanup(struct rxe_pool_entry *arg)
                qp->resp.mr = NULL;
        }
 
-       if (qp_type(qp) == IB_QPT_RC) {
-               struct dst_entry *dst = NULL;
-
-               dst = sk_dst_get(qp->sk->sk);
-               if (dst)
-                       dst_release(dst);
-       }
+       if (qp_type(qp) == IB_QPT_RC)
+               sk_dst_reset(qp->sk->sk);
 
        free_rd_atomic_resources(qp);