Merge branch 'for-4.2-misc' into k.o/for-4.2

This commit is contained in:
Doug Ledford 2015-06-11 01:13:30 -04:00
commit 0699ee7ad7
3 changed files with 5 additions and 11 deletions

View File

@ -77,7 +77,6 @@ s64 mthca_make_profile(struct mthca_dev *dev,
u64 mem_base, mem_avail; u64 mem_base, mem_avail;
s64 total_size = 0; s64 total_size = 0;
struct mthca_resource *profile; struct mthca_resource *profile;
struct mthca_resource tmp;
int i, j; int i, j;
profile = kzalloc(MTHCA_RES_NUM * sizeof *profile, GFP_KERNEL); profile = kzalloc(MTHCA_RES_NUM * sizeof *profile, GFP_KERNEL);
@ -136,11 +135,8 @@ s64 mthca_make_profile(struct mthca_dev *dev,
*/ */
for (i = MTHCA_RES_NUM; i > 0; --i) for (i = MTHCA_RES_NUM; i > 0; --i)
for (j = 1; j < i; ++j) { for (j = 1; j < i; ++j) {
if (profile[j].size > profile[j - 1].size) { if (profile[j].size > profile[j - 1].size)
tmp = profile[j]; swap(profile[j], profile[j - 1]);
profile[j] = profile[j - 1];
profile[j - 1] = tmp;
}
} }
for (i = 0; i < MTHCA_RES_NUM; ++i) { for (i = 0; i < MTHCA_RES_NUM; ++i) {

View File

@ -684,7 +684,6 @@ err:
ocrdma_release_ucontext_pd(uctx); ocrdma_release_ucontext_pd(uctx);
} else { } else {
status = _ocrdma_dealloc_pd(dev, pd); status = _ocrdma_dealloc_pd(dev, pd);
kfree(pd);
} }
exit: exit:
return ERR_PTR(status); return ERR_PTR(status);

View File

@ -472,11 +472,10 @@ struct usnic_uiom_pd *usnic_uiom_alloc_pd(void)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
pd->domain = domain = iommu_domain_alloc(&pci_bus_type); pd->domain = domain = iommu_domain_alloc(&pci_bus_type);
if (IS_ERR_OR_NULL(domain)) { if (!domain) {
usnic_err("Failed to allocate IOMMU domain with err %ld\n", usnic_err("Failed to allocate IOMMU domain");
PTR_ERR(pd->domain));
kfree(pd); kfree(pd);
return ERR_PTR(domain ? PTR_ERR(domain) : -ENOMEM); return ERR_PTR(-ENOMEM);
} }
iommu_set_fault_handler(pd->domain, usnic_uiom_dma_fault, NULL); iommu_set_fault_handler(pd->domain, usnic_uiom_dma_fault, NULL);