From: Ezequiel Garcia <ezequiel@collabora.com>
To: dri-devel@lists.freedesktop.org,
virtualization@lists.linux-foundation.org
Cc: David Airlie <airlied@linux.ie>,
Ezequiel Garcia <ezequiel@collabora.com>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: [PATCH] drm/virtio: Remove incorrect kfree()
Date: Wed, 2 Jan 2019 14:55:06 -0300 [thread overview]
Message-ID: <20190102175507.4653-1-ezequiel@collabora.com> (raw)
The virtio_gpu_output is a member of struct virtio_gpu_device
and is not a dynamically-allocated chunk, so it's wrong to kfree() it.
Removing it fixes a memory corruption BUG() that can be triggered
when the virtio-gpu driver is removed.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
drivers/gpu/drm/virtio/virtgpu_display.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
index e1c223e18d86..d539bc28dc97 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -243,12 +243,8 @@ static enum drm_connector_status virtio_gpu_conn_detect(
static void virtio_gpu_conn_destroy(struct drm_connector *connector)
{
- struct virtio_gpu_output *virtio_gpu_output =
- drm_connector_to_virtio_gpu_output(connector);
-
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
- kfree(virtio_gpu_output);
}
static const struct drm_connector_funcs virtio_gpu_connector_funcs = {
--
2.20.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2019-01-02 17:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-02 17:55 Ezequiel Garcia [this message]
2019-01-02 17:55 ` [PATCH] drm/virtio: Add missing virtqueue reset Ezequiel Garcia
2019-01-08 10:40 ` [PATCH] drm/virtio: Remove incorrect kfree() Gerd Hoffmann
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=20190102175507.4653-1-ezequiel@collabora.com \
--to=ezequiel@collabora.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=kraxel@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/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