linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: linuxppc-dev@lists.ozlabs.org,
	David Gibson <david@gibson.dropbear.id.au>,
	kvm@vger.kernel.org
Subject: Re: [PATCH kernel] vfio/spapr: Fix missing mutex unlock when creating a window
Date: Wed, 1 Feb 2017 10:06:42 -0700	[thread overview]
Message-ID: <20170201100642.02d9c1e6@t450s.home> (raw)
In-Reply-To: <20170201032616.23350-1-aik@ozlabs.ru>

On Wed,  1 Feb 2017 14:26:16 +1100
Alexey Kardashevskiy <aik@ozlabs.ru> wrote:

> d9c728949ddc: "vfio/spapr: Postpone default window creation" added
> an additional exit to the VFIO_IOMMU_SPAPR_TCE_CREATE case and made it
> possible to return from tce_iommu_ioctl() without unlocking
> container->lock; this fixes the issue.
> 
> Fixes: d9c728949ddc
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  drivers/vfio/vfio_iommu_spapr_tce.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)

Applies to for-linus branch for v4.10-rc7 w/ David's R-b.  Thanks,

Alex
 
> diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c
> index 128d10282d16..7690e5bf3cf1 100644
> --- a/drivers/vfio/vfio_iommu_spapr_tce.c
> +++ b/drivers/vfio/vfio_iommu_spapr_tce.c
> @@ -1123,12 +1123,11 @@ static long tce_iommu_ioctl(void *iommu_data,
>  		mutex_lock(&container->lock);
>  
>  		ret = tce_iommu_create_default_window(container);
> -		if (ret)
> -			return ret;
> -
> -		ret = tce_iommu_create_window(container, create.page_shift,
> -				create.window_size, create.levels,
> -				&create.start_addr);
> +		if (!ret)
> +			ret = tce_iommu_create_window(container,
> +					create.page_shift,
> +					create.window_size, create.levels,
> +					&create.start_addr);
>  
>  		mutex_unlock(&container->lock);
>  

      parent reply	other threads:[~2017-02-01 17:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01  3:26 [PATCH kernel] vfio/spapr: Fix missing mutex unlock when creating a window Alexey Kardashevskiy
2017-02-01  3:39 ` David Gibson
2017-02-01 17:06 ` Alex Williamson [this message]

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=20170201100642.02d9c1e6@t450s.home \
    --to=alex.williamson@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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;
as well as URLs for NNTP newsgroup(s).