]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/vkms: Fix use after frees on error paths
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 24 Oct 2025 11:15:23 +0000 (14:15 +0300)
committerLouis Chauvet <louis.chauvet@bootlin.com>
Tue, 4 Nov 2025 10:46:03 +0000 (11:46 +0100)
commitf9e46acc172138a472ffb3bf0270a0b156a77411
tree07b01dffdf82ff5c6add50fb9f1fa737b76850aa
parent71829d7f2f702148a238672785614e1a765fcece
drm/vkms: Fix use after frees on error paths

These error paths free a pointer and then dereference it on the next line
to get the error code.  Save the error code first and then free the
memory.

Fixes: 3e4d5b30d2b2 ("drm/vkms: Allow to configure multiple CRTCs via configfs")
Fixes: 2f1734ba271b ("drm/vkms: Allow to configure multiple planes via configfs")
Fixes: 67d8cf92e13e ("drm/vkms: Allow to configure multiple encoders via configfs")
Fixes: 272acbca96a3 ("drm/vkms: Allow to configure multiple connectors via configfs")
Fixes: 13fc9b9745cc ("drm/vkms: Add and remove VKMS instances via configfs")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Link: https://lore.kernel.org/r/aPtfy2jCI_kb3Df7@stanley.mountain
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
drivers/gpu/drm/vkms/vkms_configfs.c