drm/vkms: Use drmm_mode_config_init()

Use drmm_mode_config_init() instead of drm_mode_config_init(), as it allows
us to assure that the resource will be properly cleaned.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230116205800.1266227-2-mcanal@igalia.com
This commit is contained in:
Maíra Canal 2023-01-16 17:58:01 -03:00 committed by Maíra Canal
parent 99cc528ebe
commit 17e05aeb3b
No known key found for this signature in database
GPG Key ID: B02EE8FD76781ED5
1 changed files with 5 additions and 1 deletions

View File

@ -133,8 +133,12 @@ static const struct drm_mode_config_helper_funcs vkms_mode_config_helpers = {
static int vkms_modeset_init(struct vkms_device *vkmsdev) static int vkms_modeset_init(struct vkms_device *vkmsdev)
{ {
struct drm_device *dev = &vkmsdev->drm; struct drm_device *dev = &vkmsdev->drm;
int ret;
ret = drmm_mode_config_init(dev);
if (ret)
return ret;
drm_mode_config_init(dev);
dev->mode_config.funcs = &vkms_mode_funcs; dev->mode_config.funcs = &vkms_mode_funcs;
dev->mode_config.min_width = XRES_MIN; dev->mode_config.min_width = XRES_MIN;
dev->mode_config.min_height = YRES_MIN; dev->mode_config.min_height = YRES_MIN;