The ->parent_module is the one that use in try_module_get. It should also be the one the we use in module_put during vfio_platform_open().
Unified · Split
| @@ -291,7 +291,7 @@ err_irq: · 290 unmodified lines | |||
| 291 | vfio_platform_regions_cleanup(vdev); | 291 | vfio_platform_regions_cleanup(vdev); |
| 292 | err_reg: | 292 | err_reg: |
| 293 | mutex_unlock(&driver_lock); | 293 | mutex_unlock(&driver_lock); |
| 294 | module_put(THIS_MODULE); | 294 | module_put(vdev->parent_module); |
| 295 | return ret; | 295 | return ret; |
| 296 | } | 296 | } |
| 297 | 297 | ||