From fb16d8c49e6fa2791620cf2cd61d6daa123ed51e Mon Sep 17 00:00:00 2001 From: Selvin Xavier Date: Tue, 20 Oct 2015 14:17:57 +0530 Subject: [PATCH] RDMA/ocrdma: Avoid a possible crash in ocrdma_rem_port_stats debugfs_remove should be called before freeing the driver stats resources to avoid any crash during ocrdma_remove. Signed-off-by: Devesh Sharma Signed-off-by: Selvin Xavier Signed-off-by: Doug Ledford --- drivers/infiniband/hw/ocrdma/ocrdma_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_stats.c b/drivers/infiniband/hw/ocrdma/ocrdma_stats.c index 69334e214571..86c303a620c1 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_stats.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_stats.c @@ -855,9 +855,9 @@ void ocrdma_rem_port_stats(struct ocrdma_dev *dev) { if (!dev->dir) return; + debugfs_remove(dev->dir); mutex_destroy(&dev->stats_lock); ocrdma_release_stats_mem(dev); - debugfs_remove(dev->dir); } void ocrdma_init_debugfs(void) -- 2.30.2