|
@@ -78,6 +78,9 @@ struct drm_property *drm_property_create(struct drm_device *dev, int flags,
|
|
struct drm_property *property = NULL;
|
|
struct drm_property *property = NULL;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ if (WARN_ON(strlen(name) >= DRM_PROP_NAME_LEN))
|
|
|
|
+ return NULL;
|
|
|
|
+
|
|
property = kzalloc(sizeof(struct drm_property), GFP_KERNEL);
|
|
property = kzalloc(sizeof(struct drm_property), GFP_KERNEL);
|
|
if (!property)
|
|
if (!property)
|
|
return NULL;
|
|
return NULL;
|
|
@@ -372,6 +375,9 @@ int drm_property_add_enum(struct drm_property *property, int index,
|
|
{
|
|
{
|
|
struct drm_property_enum *prop_enum;
|
|
struct drm_property_enum *prop_enum;
|
|
|
|
|
|
|
|
+ if (WARN_ON(strlen(name) >= DRM_PROP_NAME_LEN))
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
if (!(drm_property_type_is(property, DRM_MODE_PROP_ENUM) ||
|
|
if (!(drm_property_type_is(property, DRM_MODE_PROP_ENUM) ||
|
|
drm_property_type_is(property, DRM_MODE_PROP_BITMASK)))
|
|
drm_property_type_is(property, DRM_MODE_PROP_BITMASK)))
|
|
return -EINVAL;
|
|
return -EINVAL;
|