From: Dan Carpenter <dan.carpenter@oracle.com>
To: 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: [patch] drm/etnaviv: unlock on error in etnaviv_gem_get_iova()
Date: Mon, 04 Jan 2016 13:10:24 +0000 [thread overview]
Message-ID: <20160104131024.GA13563@mwanda> (raw)
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;
next reply other threads:[~2016-01-04 13:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-04 13:10 Dan Carpenter [this message]
2016-01-04 13:48 ` [patch] drm/etnaviv: unlock on error in etnaviv_gem_get_iova() SF Markus Elfring
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=20160104131024.GA13563@mwanda \
--to=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