]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
IB/hfi1: Release node on insert failure
authorDean Luick <dean.luick@intel.com>
Thu, 28 Jul 2016 19:21:16 +0000 (15:21 -0400)
committerDoug Ledford <dledford@redhat.com>
Wed, 3 Aug 2016 02:46:21 +0000 (22:46 -0400)
If unable to insert node into the RB tree cache, node will be freed
before returning from the function.  Null out iovec's pointer to node
so iovec does not try to free it later.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/user_sdma.c

index 42cc371cdf957ce2bc72ccb59bee28e4825ed8a8..ff03e1dad5b9e589a9d7dc78d495bf73e6f1491d 100644 (file)
@@ -1239,6 +1239,7 @@ retry:
                        list_del(&node->list);
                pq->n_locked -= node->npages;
                spin_unlock(&pq->evict_lock);
+               iovec->node = NULL;
                goto bail;
        }
        return 0;