All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: David Gibson <david@gibson.dropbear.id.au>, kvm@vger.kernel.org
Subject: Re: [PATCH kernel] vfio/spapr_tce: Check kzalloc() return when preregistering memory
Date: Tue, 11 Apr 2017 13:53:09 -0600	[thread overview]
Message-ID: <20170411135300.134c6254@t450s.home> (raw)
In-Reply-To: <982ff977-620a-e940-8d64-24bb213ea931@ozlabs.ru>

On Tue, 11 Apr 2017 18:27:49 +1000
Alexey Kardashevskiy <aik@ozlabs.ru> wrote:

> On 27/03/17 15:24, David Gibson wrote:
> > On Mon, Mar 27, 2017 at 02:23:40PM +1100, Alexey Kardashevskiy wrote:  
> >> This adds missing checking for kzalloc() return value.
> >>
> >> Fixes: 4b6fad7097f8 ("powerpc/mm/iommu, vfio/spapr: Put pages on VFIO container shutdown")
> >> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>  
> > 
> > Reviewed-by: David Gibson <david@gibson.dropbear.id.au>  
> 
> 
> Alex?

I've updated my next branch, I've got these from you:

3393af24b665 vfio/spapr_tce: Check kzalloc() return when preregistering memory
1282ba7fc28d vfio/powerpc/spapr_tce: Enforce IOMMU type compatibility check

Am I missing anything else that needs to go through my tree for v4.12?
Thanks,

Alex
  
> >> ---
> >>  drivers/vfio/vfio_iommu_spapr_tce.c | 5 +++++
> >>  1 file changed, 5 insertions(+)
> >>
> >> diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c
> >> b/drivers/vfio/vfio_iommu_spapr_tce.c index
> >> cf3de91fbfe7..c298bb36e27a 100644 ---
> >> a/drivers/vfio/vfio_iommu_spapr_tce.c +++
> >> b/drivers/vfio/vfio_iommu_spapr_tce.c @@ -198,6 +198,11 @@ static
> >> long tce_iommu_register_pages(struct tce_container *container,
> >> return ret; 
> >>  	tcemem = kzalloc(sizeof(*tcemem), GFP_KERNEL);
> >> +	if (!tcemem) {
> >> +		mm_iommu_put(container->mm, mem);
> >> +		return -ENOMEM;
> >> +	}
> >> +
> >>  	tcemem->mem = mem;
> >>  	list_add(&tcemem->next, &container->prereg_list);
> >>    
> >   
> 
> 

  reply	other threads:[~2017-04-11 20:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27  3:23 [PATCH kernel] vfio/spapr_tce: Check kzalloc() return when preregistering memory Alexey Kardashevskiy
2017-03-27  4:24 ` David Gibson
2017-04-11  8:27   ` Alexey Kardashevskiy
2017-04-11 19:53     ` Alex Williamson [this message]
2017-04-11 23:40       ` Alexey Kardashevskiy

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=20170411135300.134c6254@t450s.home \
    --to=alex.williamson@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=kvm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.