intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] drm: Don't create properties without names
@ 2018-03-02 13:25 Ville Syrjala
  2018-03-02 13:25 ` [PATCH 2/3] drm: Check property/enum name length Ville Syrjala
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Ville Syrjala @ 2018-03-02 13:25 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Creating a property that doesn't have a name makes no sense to me. Don't
allow it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_property.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c
index bae50e6b819d..fe8627fb7ae6 100644
--- a/drivers/gpu/drm/drm_property.c
+++ b/drivers/gpu/drm/drm_property.c
@@ -99,10 +99,8 @@ struct drm_property *drm_property_create(struct drm_device *dev, int flags,
 	property->num_values = num_values;
 	INIT_LIST_HEAD(&property->enum_list);
 
-	if (name) {
-		strncpy(property->name, name, DRM_PROP_NAME_LEN);
-		property->name[DRM_PROP_NAME_LEN-1] = '\0';
-	}
+	strncpy(property->name, name, DRM_PROP_NAME_LEN);
+	property->name[DRM_PROP_NAME_LEN-1] = '\0';
 
 	list_add_tail(&property->head, &dev->mode_config.property_list);
 
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-03-06 15:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-02 13:25 [PATCH 1/3] drm: Don't create properties without names Ville Syrjala
2018-03-02 13:25 ` [PATCH 2/3] drm: Check property/enum name length Ville Syrjala
2018-03-02 14:03   ` [PATCH v2 2/3 " Ville Syrjala
2018-03-06 10:22     ` [Intel-gfx] " Daniel Vetter
2018-03-06 11:50       ` Ville Syrjälä
2018-03-02 13:25 ` [PATCH v2 3/3] drm: Add BT.2020 constant luminance enum value for the COLOR_ENCODING property Ville Syrjala
2018-03-02 13:58 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/3] drm: Don't create properties without names Patchwork
2018-03-02 14:13 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-02 14:55 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm: Don't create properties without names (rev2) Patchwork
2018-03-02 16:59 ` ✓ Fi.CI.IGT: " Patchwork
2018-03-06 10:18 ` [PATCH 1/3] drm: Don't create properties without names Daniel Vetter
2018-03-06 13:35 ` [Intel-gfx] " Emil Velikov
2018-03-06 13:54   ` Ville Syrjälä
2018-03-06 15:41     ` Emil Velikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).