Merge tag 'fscrypt_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[sfrench/cifs-2.6.git] / arch / powerpc / platforms / powernv / pci.c
index eb835e977e33a046a9f99b6960dfd03ba46298b9..935ccb249a8ae21a8e8ee9f9af4793a5bf6b7394 100644 (file)
@@ -758,7 +758,7 @@ void pnv_tce_free(struct iommu_table *tbl, long index, long npages)
 
 unsigned long pnv_tce_get(struct iommu_table *tbl, long index)
 {
-       return *(pnv_tce(tbl, index - tbl->it_offset));
+       return be64_to_cpu(*(pnv_tce(tbl, index - tbl->it_offset)));
 }
 
 struct iommu_table *pnv_pci_table_alloc(int nid)
@@ -766,7 +766,11 @@ struct iommu_table *pnv_pci_table_alloc(int nid)
        struct iommu_table *tbl;
 
        tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL, nid);
+       if (!tbl)
+               return NULL;
+
        INIT_LIST_HEAD_RCU(&tbl->it_group_list);
+       kref_init(&tbl->it_kref);
 
        return tbl;
 }