lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260128232038.2399-2-dakr@kernel.org>
Date: Thu, 29 Jan 2026 00:20:34 +0100
From: Danilo Krummrich <dakr@...nel.org>
To: maarten.lankhorst@...ux.intel.com,
	mripard@...nel.org,
	tzimmermann@...e.de,
	airlied@...il.com,
	simona@...ll.ch,
	louis.chauvet@...tlin.com,
	hamohammed.sa@...il.com,
	melissa.srw@...il.com,
	lyude@...hat.com,
	gregkh@...uxfoundation.org,
	rafael@...nel.org
Cc: driver-core@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	dri-devel@...ts.freedesktop.org,
	Danilo Krummrich <dakr@...nel.org>
Subject: [PATCH 2/2] drm: vkms: do not use devres groups

Using devres groups in vkms is unnecessary, as the corresponding cleanup
happens automatically when the device is unbound through
faux_device_destroy().

Signed-off-by: Danilo Krummrich <dakr@...nel.org>
---
 drivers/gpu/drm/vkms/vkms_drv.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
index 434c295f44ba..585fd642281c 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.c
+++ b/drivers/gpu/drm/vkms/vkms_drv.c
@@ -169,16 +169,11 @@ int vkms_create(struct vkms_config *config)
 	if (!fdev)
 		return -ENODEV;
 
-	if (!devres_open_group(&fdev->dev, NULL, GFP_KERNEL)) {
-		ret = -ENOMEM;
-		goto out_unregister;
-	}
-
 	vkms_device = devm_drm_dev_alloc(&fdev->dev, &vkms_driver,
 					 struct vkms_device, drm);
 	if (IS_ERR(vkms_device)) {
 		ret = PTR_ERR(vkms_device);
-		goto out_devres;
+		goto out;
 	}
 	vkms_device->faux_dev = fdev;
 	vkms_device->config = config;
@@ -189,33 +184,31 @@ int vkms_create(struct vkms_config *config)
 
 	if (ret) {
 		DRM_ERROR("Could not initialize DMA support\n");
-		goto out_devres;
+		goto out;
 	}
 
 	ret = drm_vblank_init(&vkms_device->drm,
 			      vkms_config_get_num_crtcs(config));
 	if (ret) {
 		DRM_ERROR("Failed to vblank\n");
-		goto out_devres;
+		goto out;
 	}
 
 	ret = vkms_modeset_init(vkms_device);
 	if (ret)
-		goto out_devres;
+		goto out;
 
 	vkms_config_register_debugfs(vkms_device);
 
 	ret = drm_dev_register(&vkms_device->drm, 0);
 	if (ret)
-		goto out_devres;
+		goto out;
 
 	drm_client_setup(&vkms_device->drm, NULL);
 
 	return 0;
 
-out_devres:
-	devres_release_group(&fdev->dev, NULL);
-out_unregister:
+out:
 	faux_device_destroy(fdev);
 	return ret;
 }
@@ -262,7 +255,6 @@ void vkms_destroy(struct vkms_config *config)
 	drm_colorop_pipeline_destroy(&config->dev->drm);
 	drm_dev_unregister(&config->dev->drm);
 	drm_atomic_helper_shutdown(&config->dev->drm);
-	devres_release_group(&fdev->dev, NULL);
 	faux_device_destroy(fdev);
 
 	config->dev = NULL;
-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ