@@ -41,7 +41,7 @@ int iommufd_vfio_compat_ioas_get_id(struct iommufd_ctx *ictx, u32 *out_ioas_id)
41
41
if (IS_ERR (ioas ))
42
42
return PTR_ERR (ioas );
43
43
* out_ioas_id = ioas -> obj .id ;
44
- iommufd_put_object (& ioas -> obj );
44
+ iommufd_put_object (ictx , & ioas -> obj );
45
45
return 0 ;
46
46
}
47
47
EXPORT_SYMBOL_NS_GPL (iommufd_vfio_compat_ioas_get_id , IOMMUFD_VFIO );
@@ -98,7 +98,7 @@ int iommufd_vfio_compat_ioas_create(struct iommufd_ctx *ictx)
98
98
99
99
if (ictx -> vfio_ioas && iommufd_lock_obj (& ictx -> vfio_ioas -> obj )) {
100
100
ret = 0 ;
101
- iommufd_put_object (& ictx -> vfio_ioas -> obj );
101
+ iommufd_put_object (ictx , & ictx -> vfio_ioas -> obj );
102
102
goto out_abort ;
103
103
}
104
104
ictx -> vfio_ioas = ioas ;
@@ -133,7 +133,7 @@ int iommufd_vfio_ioas(struct iommufd_ucmd *ucmd)
133
133
if (IS_ERR (ioas ))
134
134
return PTR_ERR (ioas );
135
135
cmd -> ioas_id = ioas -> obj .id ;
136
- iommufd_put_object (& ioas -> obj );
136
+ iommufd_put_object (ucmd -> ictx , & ioas -> obj );
137
137
return iommufd_ucmd_respond (ucmd , sizeof (* cmd ));
138
138
139
139
case IOMMU_VFIO_IOAS_SET :
@@ -143,7 +143,7 @@ int iommufd_vfio_ioas(struct iommufd_ucmd *ucmd)
143
143
xa_lock (& ucmd -> ictx -> objects );
144
144
ucmd -> ictx -> vfio_ioas = ioas ;
145
145
xa_unlock (& ucmd -> ictx -> objects );
146
- iommufd_put_object (& ioas -> obj );
146
+ iommufd_put_object (ucmd -> ictx , & ioas -> obj );
147
147
return 0 ;
148
148
149
149
case IOMMU_VFIO_IOAS_CLEAR :
@@ -190,7 +190,7 @@ static int iommufd_vfio_map_dma(struct iommufd_ctx *ictx, unsigned int cmd,
190
190
iova = map .iova ;
191
191
rc = iopt_map_user_pages (ictx , & ioas -> iopt , & iova , u64_to_user_ptr (map .vaddr ),
192
192
map .size , iommu_prot , 0 );
193
- iommufd_put_object (& ioas -> obj );
193
+ iommufd_put_object (ictx , & ioas -> obj );
194
194
return rc ;
195
195
}
196
196
@@ -249,7 +249,7 @@ static int iommufd_vfio_unmap_dma(struct iommufd_ctx *ictx, unsigned int cmd,
249
249
rc = - EFAULT ;
250
250
251
251
err_put :
252
- iommufd_put_object (& ioas -> obj );
252
+ iommufd_put_object (ictx , & ioas -> obj );
253
253
return rc ;
254
254
}
255
255
@@ -272,7 +272,7 @@ static int iommufd_vfio_cc_iommu(struct iommufd_ctx *ictx)
272
272
}
273
273
mutex_unlock (& ioas -> mutex );
274
274
275
- iommufd_put_object (& ioas -> obj );
275
+ iommufd_put_object (ictx , & ioas -> obj );
276
276
return rc ;
277
277
}
278
278
@@ -349,7 +349,7 @@ static int iommufd_vfio_set_iommu(struct iommufd_ctx *ictx, unsigned long type)
349
349
*/
350
350
if (type == VFIO_TYPE1_IOMMU )
351
351
rc = iopt_disable_large_pages (& ioas -> iopt );
352
- iommufd_put_object (& ioas -> obj );
352
+ iommufd_put_object (ictx , & ioas -> obj );
353
353
return rc ;
354
354
}
355
355
@@ -511,7 +511,7 @@ static int iommufd_vfio_iommu_get_info(struct iommufd_ctx *ictx,
511
511
512
512
out_put :
513
513
up_read (& ioas -> iopt .iova_rwsem );
514
- iommufd_put_object (& ioas -> obj );
514
+ iommufd_put_object (ictx , & ioas -> obj );
515
515
return rc ;
516
516
}
517
517
0 commit comments