lkml.org 
[lkml]   [2022]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] iommufd: unlock ictx->vfio_compat before return.
Date
cocci warning: drivers/iommu/iommufd/vfio_compat.c:494:2-8: preceding
lock on line 491

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Saud Farooqui <farooqui_saud@hotmail.com>
---
drivers/iommu/iommufd/vfio_compat.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/iommufd/vfio_compat.c b/drivers/iommu/iommufd/vfio_compat.c
index 5b196de00ff9..d9347df48cc8 100644
--- a/drivers/iommu/iommufd/vfio_compat.c
+++ b/drivers/iommu/iommufd/vfio_compat.c
@@ -491,8 +491,10 @@ void vfio_group_unset_iommufd(void *iommufd, struct list_head *device_list)
return;
mutex_lock(&ictx->vfio_compat);
ioas = get_compat_ioas(ictx);
- if (IS_ERR(ioas))
+ if (IS_ERR(ioas)) {
+ mutex_unlock(&ictx->vfio_compat);
return;
+ }

ioas_id = ioas->obj.id;
iommufd_put_object(&ioas->obj);
--
2.25.1
\
 
 \ /
  Last update: 2022-04-17 04:50    [W:0.027 / U:3.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site