From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Lucas Stach <l.stach@pengutronix.de>
Cc: Russell King <linux+etnaviv@arm.linux.org.uk>,
kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [patch] drm/etnaviv: unlock on error in etnaviv_gem_get_iova()
Date: Mon, 04 Jan 2016 13:48:48 +0000 [thread overview]
Message-ID: <568A7840.6020205@users.sourceforge.net> (raw)
In-Reply-To: <20160104131024.GA13563@mwanda>
> We have to drop a lock before returning -ENOMEM here.
>
> Fixes: a8c21a5451d8 ('drm/etnaviv: add initial etnaviv DRM driver')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> index 8d6f859..9f77c3b 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> @@ -305,8 +305,10 @@ int etnaviv_gem_get_iova(struct etnaviv_gpu *gpu,
> mapping = etnaviv_gem_get_vram_mapping(etnaviv_obj, NULL);
> if (!mapping) {
> mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
> - if (!mapping)
> - return -ENOMEM;
> + if (!mapping) {
> + ret = -ENOMEM;
> + goto out;
> + }
>
> INIT_LIST_HEAD(&mapping->scan_node);
> mapping->object = etnaviv_obj;
How do you think about to reuse the jump label "unlock" there
like it is used in other source files?
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/drm/etnaviv/etnaviv_gem.c?id¨c21a5451d831e67b7a6fb910f9ca8bc7b43554#n263
Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-01-04 13:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-04 13:10 [patch] drm/etnaviv: unlock on error in etnaviv_gem_get_iova() Dan Carpenter
2016-01-04 13:48 ` SF Markus Elfring [this message]
2016-01-04 13:54 ` Russell King - ARM Linux
2016-01-04 14:13 ` Lucas Stach
2016-01-04 14:34 ` Russell King - ARM Linux
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=568A7840.6020205@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=l.stach@pengutronix.de \
--cc=linux+etnaviv@arm.linux.org.uk \
/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