Commit 8e5e83ad authored by Ville Syrjälä's avatar Ville Syrjälä

drm: Don't create properties without names

Creating a property that doesn't have a name makes no sense to me. Don't
allow it.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302132544.12491-1-ville.syrjala@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 9c305eb4
...@@ -99,10 +99,8 @@ struct drm_property *drm_property_create(struct drm_device *dev, int flags, ...@@ -99,10 +99,8 @@ struct drm_property *drm_property_create(struct drm_device *dev, int flags,
property->num_values = num_values; property->num_values = num_values;
INIT_LIST_HEAD(&property->enum_list); INIT_LIST_HEAD(&property->enum_list);
if (name) {
strncpy(property->name, name, DRM_PROP_NAME_LEN); strncpy(property->name, name, DRM_PROP_NAME_LEN);
property->name[DRM_PROP_NAME_LEN-1] = '\0'; property->name[DRM_PROP_NAME_LEN-1] = '\0';
}
list_add_tail(&property->head, &dev->mode_config.property_list); list_add_tail(&property->head, &dev->mode_config.property_list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment