From: Masaru Nomura <massa.nomura@gmail.com>
To: airlied@linux.ie
Cc: thellstrom@vmware.com, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Masaru Nomura <massa.nomura@gmail.com>
Subject: [PATCH 1/3] gpu: drm: vmwgfx: Fix memory leak by adding drm_ht_remove()
Date: Tue, 24 Jun 2014 21:52:12 +0000 [thread overview]
Message-ID: <1403646734-2838-2-git-send-email-massa.nomura@gmail.com> (raw)
In-Reply-To: <1403646734-2838-1-git-send-email-massa.nomura@gmail.com>
drm_ht_remove() should be called in vmw_compat_shader_man_destroy()
This is because memory was allocated for (&man->shaders)->table by
vmw_compat_shader_man_create() -> drm_ht_create()
but this memory is not freed when vmw_compat_shader_mager is destroied.
Signed-off-by: Masaru Nomura <massa.nomura@gmail.com>
---
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
index c1559eea..01cc8ea 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
@@ -806,6 +806,8 @@ void vmw_compat_shader_man_destroy(struct vmw_compat_shader_manager *man)
list_for_each_entry_safe(entry, next, &man->list, head)
vmw_compat_shader_free(man, entry);
+ drm_ht_remove(&man->shaders);
+
mutex_unlock(&man->dev_priv->cmdbuf_mutex);
kfree(man);
}
--
1.9.3
next prev parent reply other threads:[~2014-06-24 21:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 21:52 [PATCH 0/3] gpu: drm: Fix memory leak in vmwgfx_shader.c Masaru Nomura
2014-06-24 21:52 ` Masaru Nomura [this message]
2014-06-24 21:52 ` [PATCH 2/3] gpu: drm: Remove unnecessary parameter from drm_ht_remove_item() Masaru Nomura
2014-07-08 11:24 ` Daniel Vetter
2014-07-08 11:40 ` Thomas Hellstrom
2014-07-08 13:41 ` Daniel Vetter
2014-06-24 21:52 ` [PATCH 3/3] gpu: drm: vmwgfx: Remove unnecessary parameter from vmw_compat_shader_free() Masaru Nomura
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=1403646734-2838-2-git-send-email-massa.nomura@gmail.com \
--to=massa.nomura@gmail.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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