[PATCH 3/3] drm/omap: Fix locking in omap_gem_new_dmabuf()
Markus Elfring
Markus.Elfring at web.de
Tue Aug 6 15:20:24 UTC 2024
…
> +++ 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
More information about the dri-devel
mailing list