Re: [PATCH 05/21] drm/i915/gtt: Don't leak scratch page on mapping error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 01, 2015 at 06:02:52PM +0300, Joonas Lahtinen wrote:
> On pe, 2015-05-22 at 20:04 +0300, Mika Kuoppala wrote:
> > Free the scratch page if dma mapping fails.
> > 
> > Signed-off-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxx>
> 
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>

Queued for -next, thanks for the patch.
-Daniel

> 
> > ---
> >  drivers/gpu/drm/i915/i915_gem_gtt.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > index c61de4a..a608b1b 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > @@ -2191,8 +2191,10 @@ static int setup_scratch_page(struct drm_device *dev)
> >  #ifdef CONFIG_INTEL_IOMMU
> >  	dma_addr = pci_map_page(dev->pdev, page, 0, PAGE_SIZE,
> >  				PCI_DMA_BIDIRECTIONAL);
> > -	if (pci_dma_mapping_error(dev->pdev, dma_addr))
> > +	if (pci_dma_mapping_error(dev->pdev, dma_addr)) {
> > +		__free_page(page);
> >  		return -EINVAL;
> > +	}
> >  #else
> >  	dma_addr = page_to_phys(page);
> >  #endif
> 
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux