Re: [PATCH v5 32/38] drm/vkms: Introduce config for connector EDID
From: Daniel Campos Ramos
Date: Fri Oct 09 2026 - 02:34:20 EST
Hi Louis,
I use the EDID attributes of this series to give a VKMS connector the
EDID of a 3D display, for tests of HDMI 3D modes without one (RFC to
follow). Running it with kmemleak showed one leak in this patch.
On Sat, 27 Jun 2026 05:30:49 +0200, Louis Chauvet wrote:
> +static inline void
> +vkms_config_connector_set_edid(struct vkms_config_connector *connector_cfg,
> + const u8 *edid, unsigned int len)
> +{
> + if (len) {
> + void *edid_tmp = krealloc(connector_cfg->edid, len, GFP_KERNEL);
Nothing frees this copy when the connector configuration goes away:
vkms_config_destroy_connector() frees the configuration, not
connector_cfg->edid. Sashiko's review of this patch pointed at it too.
Measured in QEMU on your base commit with v5 applied and kmemleak on:
eight configfs connectors, each given a 256-byte EDID and removed
again, left eight unreferenced 256-byte objects allocated through
connector_edid_store(). With the change below, the same run leaves
none.
Feel free to squash it into this patch.
-- >8 --
From: Daniel Campos Ramos <Capitain_Jack@xxxxxxxxx>
Subject: [PATCH] drm/vkms: Free the connector EDID with its configuration
vkms_config_connector_set_edid() keeps a copy of the EDID in the
connector configuration, but vkms_config_destroy_connector() never
frees it, so the copy leaks each time a connector that has an EDID is
removed from configfs or its device is destroyed. Free it with the rest
of the connector configuration.
Assisted-by: LLM
Signed-off-by: Daniel Campos Ramos <Capitain_Jack@xxxxxxxxx>
---
drivers/gpu/drm/vkms/vkms_config.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/vkms/vkms_config.c b/drivers/gpu/drm/vkms/vkms_config.c
index b9d5a2e44f..04a3019317 100644
--- a/drivers/gpu/drm/vkms/vkms_config.c
+++ b/drivers/gpu/drm/vkms/vkms_config.c
@@ -1008,6 +1008,7 @@ void vkms_config_destroy_connector(struct vkms_config *config,
xa_destroy(&connector_cfg->possible_encoders);
list_del(&connector_cfg->link);
+ kfree(connector_cfg->edid);
kfree(connector_cfg);
}
EXPORT_SYMBOL_IF_KUNIT(vkms_config_destroy_connector);