aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/mad.c4
-rw-r--r--drivers/infiniband/core/umem.c2
-rw-r--r--drivers/infiniband/core/user_mad.c14
-rw-r--r--drivers/infiniband/core/uverbs_main.c13
4 files changed, 17 insertions, 16 deletions
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index fbe16d5250a4..1adf2efd3cb3 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -747,7 +747,9 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
747 break; 747 break;
748 case IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED: 748 case IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED:
749 kmem_cache_free(ib_mad_cache, mad_priv); 749 kmem_cache_free(ib_mad_cache, mad_priv);
750 break; 750 kfree(local);
751 ret = 1;
752 goto out;
751 case IB_MAD_RESULT_SUCCESS: 753 case IB_MAD_RESULT_SUCCESS:
752 /* Treat like an incoming receive MAD */ 754 /* Treat like an incoming receive MAD */
753 port_priv = ib_get_mad_port(mad_agent_priv->agent.device, 755 port_priv = ib_get_mad_port(mad_agent_priv->agent.device,
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index fe78f7d25099..a1768dbb0720 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -150,7 +150,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
150 ret = 0; 150 ret = 0;
151 while (npages) { 151 while (npages) {
152 ret = get_user_pages(current, current->mm, cur_base, 152 ret = get_user_pages(current, current->mm, cur_base,
153 min_t(int, npages, 153 min_t(unsigned long, npages,
154 PAGE_SIZE / sizeof (struct page *)), 154 PAGE_SIZE / sizeof (struct page *)),
155 1, !umem->writable, page_list, vma_list); 155 1, !umem->writable, page_list, vma_list);
156 156
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 3aa2db54eae4..840ede9ae965 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -1005,8 +1005,9 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
1005 if (cdev_add(port->cdev, base_dev + port->dev_num, 1)) 1005 if (cdev_add(port->cdev, base_dev + port->dev_num, 1))
1006 goto err_cdev; 1006 goto err_cdev;
1007 1007
1008 port->dev = device_create(umad_class, device->dma_device, 1008 port->dev = device_create_drvdata(umad_class, device->dma_device,
1009 port->cdev->dev, "umad%d", port->dev_num); 1009 port->cdev->dev, port,
1010 "umad%d", port->dev_num);
1010 if (IS_ERR(port->dev)) 1011 if (IS_ERR(port->dev))
1011 goto err_cdev; 1012 goto err_cdev;
1012 1013
@@ -1024,15 +1025,12 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
1024 if (cdev_add(port->sm_cdev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1)) 1025 if (cdev_add(port->sm_cdev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1))
1025 goto err_sm_cdev; 1026 goto err_sm_cdev;
1026 1027
1027 port->sm_dev = device_create(umad_class, device->dma_device, 1028 port->sm_dev = device_create_drvdata(umad_class, device->dma_device,
1028 port->sm_cdev->dev, 1029 port->sm_cdev->dev, port,
1029 "issm%d", port->dev_num); 1030 "issm%d", port->dev_num);
1030 if (IS_ERR(port->sm_dev)) 1031 if (IS_ERR(port->sm_dev))
1031 goto err_sm_cdev; 1032 goto err_sm_cdev;
1032 1033
1033 dev_set_drvdata(port->dev, port);
1034 dev_set_drvdata(port->sm_dev, port);
1035
1036 if (device_create_file(port->sm_dev, &dev_attr_ibdev)) 1034 if (device_create_file(port->sm_dev, &dev_attr_ibdev))
1037 goto err_sm_dev; 1035 goto err_sm_dev;
1038 if (device_create_file(port->sm_dev, &dev_attr_port)) 1036 if (device_create_file(port->sm_dev, &dev_attr_port))
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index cc1afa28c181..caed42bf7ef5 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -423,7 +423,7 @@ static void ib_uverbs_async_handler(struct ib_uverbs_file *file,
423 unsigned long flags; 423 unsigned long flags;
424 424
425 spin_lock_irqsave(&file->async_file->lock, flags); 425 spin_lock_irqsave(&file->async_file->lock, flags);
426 if (!file->async_file->is_closed) { 426 if (file->async_file->is_closed) {
427 spin_unlock_irqrestore(&file->async_file->lock, flags); 427 spin_unlock_irqrestore(&file->async_file->lock, flags);
428 return; 428 return;
429 } 429 }
@@ -755,14 +755,15 @@ static void ib_uverbs_add_one(struct ib_device *device)
755 if (cdev_add(uverbs_dev->cdev, IB_UVERBS_BASE_DEV + uverbs_dev->devnum, 1)) 755 if (cdev_add(uverbs_dev->cdev, IB_UVERBS_BASE_DEV + uverbs_dev->devnum, 1))
756 goto err_cdev; 756 goto err_cdev;
757 757
758 uverbs_dev->dev = device_create(uverbs_class, device->dma_device, 758 uverbs_dev->dev = device_create_drvdata(uverbs_class,
759 uverbs_dev->cdev->dev, 759 device->dma_device,
760 "uverbs%d", uverbs_dev->devnum); 760 uverbs_dev->cdev->dev,
761 uverbs_dev,
762 "uverbs%d",
763 uverbs_dev->devnum);
761 if (IS_ERR(uverbs_dev->dev)) 764 if (IS_ERR(uverbs_dev->dev))
762 goto err_cdev; 765 goto err_cdev;
763 766
764 dev_set_drvdata(uverbs_dev->dev, uverbs_dev);
765
766 if (device_create_file(uverbs_dev->dev, &dev_attr_ibdev)) 767 if (device_create_file(uverbs_dev->dev, &dev_attr_ibdev))
767 goto err_class; 768 goto err_class;
768 if (device_create_file(uverbs_dev->dev, &dev_attr_abi_version)) 769 if (device_create_file(uverbs_dev->dev, &dev_attr_abi_version))