From: Navid Emamdoost <navid.emamdoost@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu,
Navid Emamdoost <navid.emamdoost@gmail.com>,
VMware Graphics <linux-graphics-maintainer@vmware.com>,
Thomas Hellstrom <thellstrom@vmware.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH] drm/vmwgfx: prevent memory leak in vmw_context_define
Date: Tue, 24 Sep 2019 23:46:26 -0500 [thread overview]
Message-ID: <20190925044627.2476-1-navid.emamdoost@gmail.com> (raw)
In vmw_context_define if vmw_context_init fails the allocated resource
should be unreferenced. The goto label was fixed.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
index a56c9d802382..ac42f8a6acf0 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
@@ -773,7 +773,7 @@ static int vmw_context_define(struct drm_device *dev, void *data,
ret = vmw_context_init(dev_priv, res, vmw_user_context_free, dx);
if (unlikely(ret != 0))
- goto out_unlock;
+ goto out_err;
tmp = vmw_resource_reference(&ctx->res);
ret = ttm_base_object_init(tfile, &ctx->base, false, VMW_RES_CONTEXT,
--
2.17.1
next reply other threads:[~2019-09-25 4:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 4:46 Navid Emamdoost [this message]
2019-12-11 10:20 ` [PATCH] drm/vmwgfx: prevent memory leak in vmw_context_define Thomas Hellstrom
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=20190925044627.2476-1-navid.emamdoost@gmail.com \
--to=navid.emamdoost@gmail.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=emamd001@umn.edu \
--cc=kjlu@umn.edu \
--cc=linux-graphics-maintainer@vmware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=smccaman@umn.edu \
--cc=thellstrom@vmware.com \
/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;
as well as URLs for NNTP newsgroup(s).