From: Markus Elfring <Markus.Elfring@web.de>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
dri-devel@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>,
David Airlie <airlied@gmail.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
Thomas Zimmermann <tzimmermann@suse.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [PATCH 3/3] drm/omap: Fix locking in omap_gem_new_dmabuf()
Date: Tue, 6 Aug 2024 17:20:24 +0200 [thread overview]
Message-ID: <e518ae77-57bf-44b2-a0c7-0891ec80d03a@web.de> (raw)
In-Reply-To: <20240806-omapdrm-misc-fixes-v1-3-15d31aea0831@ideasonboard.com>
…
> +++ 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
next prev parent reply other threads:[~2024-08-06 15:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 13:50 [PATCH 0/3] drm/omap: Minor fixes Tomi Valkeinen
2024-08-06 13:50 ` [PATCH 1/3] drm/omap: Fix possible NULL dereference Tomi Valkeinen
2024-08-06 13:50 ` [PATCH 2/3] drm/omap: Hide sparse warnings Tomi Valkeinen
2024-08-06 13:50 ` [PATCH 3/3] drm/omap: Fix locking in omap_gem_new_dmabuf() Tomi Valkeinen
2024-08-06 15:20 ` Markus Elfring [this message]
2024-09-14 7:43 ` [PATCH 0/3] drm/omap: Minor fixes Sebastian Reichel
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=e518ae77-57bf-44b2-a0c7-0891ec80d03a@web.de \
--to=markus.elfring@web.de \
--cc=airlied@gmail.com \
--cc=dan.carpenter@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=tomi.valkeinen@ideasonboard.com \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®