diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index bb2f2807cd58ae..f151a5b8356089 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -2938,6 +2938,7 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv) err2: kfree(route->path_rec); route->path_rec = NULL; + route->num_paths = 0; err1: kfree(work); return ret;