public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Wan Jiabing <wanjiabing@vivo.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Yi Liu <yi.l.liu@intel.com>, Kevin Tian <kevin.tian@intel.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm/vfio: Fix potential deadlock problem in vfio
Date: Tue, 17 May 2022 15:58:45 -0300	[thread overview]
Message-ID: <20220517185845.GL63055@ziepe.ca> (raw)
In-Reply-To: <20220517023441.4258-1-wanjiabing@vivo.com>

On Tue, May 17, 2022 at 10:34:41AM +0800, Wan Jiabing wrote:
> Fix following coccicheck warning:
> ./virt/kvm/vfio.c:258:1-7: preceding lock on line 236
> 
> If kvm_vfio_file_iommu_group() failed, code would goto err_fdput with
> mutex_lock acquired and then return ret. It might cause potential
> deadlock. Move mutex_unlock bellow err_fdput tag to fix it. 
> 
> Fixes: d55d9e7a45721 ("kvm/vfio: Store the struct file in the kvm_vfio_group")
> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
> ---
>  virt/kvm/vfio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Thanks,
Jason

  reply	other threads:[~2022-05-17 18:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17  2:34 [PATCH] kvm/vfio: Fix potential deadlock problem in vfio Wan Jiabing
2022-05-17 18:58 ` Jason Gunthorpe [this message]
2022-05-18 17:51 ` Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220517185845.GL63055@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=alex.williamson@redhat.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=wanjiabing@vivo.com \
    --cc=yi.l.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox