Explorar o código

IB/hfi1: Release node on insert failure

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>
Dean Luick %!s(int64=9) %!d(string=hai) anos
pai
achega
a383f8ec55
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      drivers/infiniband/hw/hfi1/user_sdma.c

+ 1 - 0
drivers/infiniband/hw/hfi1/user_sdma.c

@@ -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;