dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/virtio: Remove incorrect kfree()
@ 2019-01-02 17:55 Ezequiel Garcia
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Ezequiel Garcia @ 2019-01-02 17:55 UTC (permalink / raw)
  To: dri-devel, virtualization; +Cc: David Airlie, Ezequiel Garcia, Gerd Hoffmann

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-08 10:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-02 17:55 [PATCH] drm/virtio: Remove incorrect kfree() Ezequiel Garcia
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox