drivers/gpu/drm/vkms/vkms_output.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
CRTC creation uses drmm_crtc_init_with_planes(), which automatically
handles cleanup. However, an unnecessary call to drm_crtc_cleanup() is
still present in the vkms_output_init() error path.
Fixes: 99cc528ebe92 ("drm/vkms: Use drmm_crtc_init_with_planes()")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
drivers/gpu/drm/vkms/vkms_output.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
index 0a5a185aa0b0..25a99fde126c 100644
--- a/drivers/gpu/drm/vkms/vkms_output.c
+++ b/drivers/gpu/drm/vkms/vkms_output.c
@@ -92,7 +92,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
DRM_MODE_CONNECTOR_VIRTUAL);
if (ret) {
DRM_ERROR("Failed to init connector\n");
- goto err_connector;
+ return ret;
}
drm_connector_helper_add(connector, &vkms_conn_helper_funcs);
@@ -131,8 +131,5 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
err_encoder:
drm_connector_cleanup(connector);
-err_connector:
- drm_crtc_cleanup(crtc);
-
return ret;
}
--
2.47.0
On 31/10/24 - 19:38, José Expósito wrote: > CRTC creation uses drmm_crtc_init_with_planes(), which automatically > handles cleanup. However, an unnecessary call to drm_crtc_cleanup() is > still present in the vkms_output_init() error path. > > Fixes: 99cc528ebe92 ("drm/vkms: Use drmm_crtc_init_with_planes()") > Signed-off-by: José Expósito <jose.exposito89@gmail.com> Acked-by: Louis Chauvet <louis.chauvet@bootlin.com> Applied on drm-misc-next: https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/1d43dddd7c38ea1aa93f78f7ee10087afb0a561f > --- > drivers/gpu/drm/vkms/vkms_output.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c > index 0a5a185aa0b0..25a99fde126c 100644 > --- a/drivers/gpu/drm/vkms/vkms_output.c > +++ b/drivers/gpu/drm/vkms/vkms_output.c > @@ -92,7 +92,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) > DRM_MODE_CONNECTOR_VIRTUAL); > if (ret) { > DRM_ERROR("Failed to init connector\n"); > - goto err_connector; > + return ret; > } > > drm_connector_helper_add(connector, &vkms_conn_helper_funcs); > @@ -131,8 +131,5 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) > err_encoder: > drm_connector_cleanup(connector); > > -err_connector: > - drm_crtc_cleanup(crtc); > - > return ret; > } > -- > 2.47.0 >
Hi José, On 31/10/24 15:38, José Expósito wrote: > CRTC creation uses drmm_crtc_init_with_planes(), which automatically > handles cleanup. However, an unnecessary call to drm_crtc_cleanup() is > still present in the vkms_output_init() error path. > > Fixes: 99cc528ebe92 ("drm/vkms: Use drmm_crtc_init_with_planes()") > Signed-off-by: José Expósito <jose.exposito89@gmail.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Best Regards, - Maíra > --- > drivers/gpu/drm/vkms/vkms_output.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c > index 0a5a185aa0b0..25a99fde126c 100644 > --- a/drivers/gpu/drm/vkms/vkms_output.c > +++ b/drivers/gpu/drm/vkms/vkms_output.c > @@ -92,7 +92,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) > DRM_MODE_CONNECTOR_VIRTUAL); > if (ret) { > DRM_ERROR("Failed to init connector\n"); > - goto err_connector; > + return ret; > } > > drm_connector_helper_add(connector, &vkms_conn_helper_funcs); > @@ -131,8 +131,5 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) > err_encoder: > drm_connector_cleanup(connector); > > -err_connector: > - drm_crtc_cleanup(crtc); > - > return ret; > }
On 31/10/24 - 19:38, José Expósito wrote: > CRTC creation uses drmm_crtc_init_with_planes(), which automatically > handles cleanup. However, an unnecessary call to drm_crtc_cleanup() is > still present in the vkms_output_init() error path. Thanks! I discussed about this with Maíra on Monday, I agree with this patch! I will test your patch next week (checkpatch, sparse, CI) before adding my Acked-by. One less cleanup line in configFS work, thanks! Thanks, Louis Chauvet > Fixes: 99cc528ebe92 ("drm/vkms: Use drmm_crtc_init_with_planes()") > Signed-off-by: José Expósito <jose.exposito89@gmail.com> > --- > drivers/gpu/drm/vkms/vkms_output.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c > index 0a5a185aa0b0..25a99fde126c 100644 > --- a/drivers/gpu/drm/vkms/vkms_output.c > +++ b/drivers/gpu/drm/vkms/vkms_output.c > @@ -92,7 +92,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) > DRM_MODE_CONNECTOR_VIRTUAL); > if (ret) { > DRM_ERROR("Failed to init connector\n"); > - goto err_connector; > + return ret; > } > > drm_connector_helper_add(connector, &vkms_conn_helper_funcs); > @@ -131,8 +131,5 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) > err_encoder: > drm_connector_cleanup(connector); > > -err_connector: > - drm_crtc_cleanup(crtc); > - > return ret; > } > -- > 2.47.0 >
© 2016 - 2024 Red Hat, Inc.