Re: [PATCH 3/3] drm/omap: Fix locking in omap_gem_new_dmabuf()

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

 



…
> +++ b/drivers/gpu/drm/omapdrm/omap_gem.c
…
> @@ -1418,21 +1416,17 @@ struct drm_gem_object *omap_gem_new_dmabuf(struct drm_device *dev, size_t size,
>  		pages = kcalloc(npages, sizeof(*pages), GFP_KERNEL);
>  		if (!pages) {
>  			omap_gem_free_object(obj);
> -			obj = ERR_PTR(-ENOMEM);
> -			goto done;
> +			return ERR_PTR(-ENOMEM);
>  		}
>
>  		omap_obj->pages = pages;
>  		ret = drm_prime_sg_to_page_array(sgt, pages, npages);
>  		if (ret) {
>  			omap_gem_free_object(obj);
> -			obj = ERR_PTR(-ENOMEM);
> -			goto done;
> +			return ERR_PTR(-ENOMEM);
>  		}
…

I suggest to use another goto chain instead so that a bit of exception handling
can be better reused at the end of this function implementation.

Regards,
Markus




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux