Re: [syzbot] [dri?] general protection fault in drm_object_attach_property

Edward Adam Davis <[email protected]>
Newsgroups org.kernel.vger.linux-kernel
Message-ID <[email protected]>
#syz test

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 11646453aaac..ecbbc967f51f 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -2175,8 +2175,12 @@ int drm_mode_create_tv_properties_legacy(struct drm_device *dev,
 	struct drm_property *tv_subconnector;
 	unsigned int i;
 
-	if (dev->mode_config.tv_select_subconnector_property)
+	if (dev->mode_config.tv_select_subconnector_property) {
+		if (num_modes && !dev->mode_config.legacy_tv_mode_property)
+			goto other;
+
 		return 0;
+	}
 
 	/*
 	 * Basic connector properties
@@ -2199,6 +2203,7 @@ int drm_mode_create_tv_properties_legacy(struct drm_device *dev,
 		goto nomem;
 	dev->mode_config.tv_subconnector_property = tv_subconnector;
 
+other:
 	/*
 	 * Other, TV specific properties: margins & TV modes.
 	 */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.