[PATCH] infiniband/core: zero out bind_list pointer in cma_release_port()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After calling kfree() on the bind_list we should be zeroing out
the pointer, otherwise a second call to cma_release_port() will
crash.

Signed-off-by: Hannes Reinecke <hare@xxxxxxxx>
---
 drivers/infiniband/core/cma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 68c997be2429..2a0010eddb33 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1770,6 +1770,7 @@ static void cma_release_port(struct rdma_id_private *id_priv)
 	if (hlist_empty(&bind_list->owners)) {
 		cma_ps_remove(net, bind_list->ps, bind_list->port);
 		kfree(bind_list);
+		id_priv->bind_list = NULL;
 	}
 	mutex_unlock(&lock);
 }
-- 
2.16.4




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux