aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/devx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/mlx5/devx.c')
-rw-r--r--drivers/infiniband/hw/mlx5/devx.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c
index ec4370f99381..af5bbb35c058 100644
--- a/drivers/infiniband/hw/mlx5/devx.c
+++ b/drivers/infiniband/hw/mlx5/devx.c
@@ -2026,7 +2026,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT)(
2026 event_sub->eventfd = 2026 event_sub->eventfd =
2027 eventfd_ctx_fdget(redirect_fd); 2027 eventfd_ctx_fdget(redirect_fd);
2028 2028
2029 if (IS_ERR(event_sub)) { 2029 if (IS_ERR(event_sub->eventfd)) {
2030 err = PTR_ERR(event_sub->eventfd); 2030 err = PTR_ERR(event_sub->eventfd);
2031 event_sub->eventfd = NULL; 2031 event_sub->eventfd = NULL;
2032 goto err; 2032 goto err;
@@ -2644,12 +2644,13 @@ static int devx_async_event_close(struct inode *inode, struct file *filp)
2644 struct devx_async_event_file *ev_file = filp->private_data; 2644 struct devx_async_event_file *ev_file = filp->private_data;
2645 struct devx_event_subscription *event_sub, *event_sub_tmp; 2645 struct devx_event_subscription *event_sub, *event_sub_tmp;
2646 struct devx_async_event_data *entry, *tmp; 2646 struct devx_async_event_data *entry, *tmp;
2647 struct mlx5_ib_dev *dev = ev_file->dev;
2647 2648
2648 mutex_lock(&ev_file->dev->devx_event_table.event_xa_lock); 2649 mutex_lock(&dev->devx_event_table.event_xa_lock);
2649 /* delete the subscriptions which are related to this FD */ 2650 /* delete the subscriptions which are related to this FD */
2650 list_for_each_entry_safe(event_sub, event_sub_tmp, 2651 list_for_each_entry_safe(event_sub, event_sub_tmp,
2651 &ev_file->subscribed_events_list, file_list) { 2652 &ev_file->subscribed_events_list, file_list) {
2652 devx_cleanup_subscription(ev_file->dev, event_sub); 2653 devx_cleanup_subscription(dev, event_sub);
2653 if (event_sub->eventfd) 2654 if (event_sub->eventfd)
2654 eventfd_ctx_put(event_sub->eventfd); 2655 eventfd_ctx_put(event_sub->eventfd);
2655 2656
@@ -2658,7 +2659,7 @@ static int devx_async_event_close(struct inode *inode, struct file *filp)
2658 kfree_rcu(event_sub, rcu); 2659 kfree_rcu(event_sub, rcu);
2659 } 2660 }
2660 2661
2661 mutex_unlock(&ev_file->dev->devx_event_table.event_xa_lock); 2662 mutex_unlock(&dev->devx_event_table.event_xa_lock);
2662 2663
2663 /* free the pending events allocation */ 2664 /* free the pending events allocation */
2664 if (!ev_file->omit_data) { 2665 if (!ev_file->omit_data) {
@@ -2670,7 +2671,7 @@ static int devx_async_event_close(struct inode *inode, struct file *filp)
2670 } 2671 }
2671 2672
2672 uverbs_close_fd(filp); 2673 uverbs_close_fd(filp);
2673 put_device(&ev_file->dev->ib_dev.dev); 2674 put_device(&dev->ib_dev.dev);
2674 return 0; 2675 return 0;
2675} 2676}
2676 2677