Commit 03e9a040 authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ben Skeggs

drm/nouveau: use drm_property_create_range helper

Avoids potential null pointer dereference.
Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent b5d8f052
...@@ -316,17 +316,13 @@ nouveau_display_create(struct drm_device *dev) ...@@ -316,17 +316,13 @@ nouveau_display_create(struct drm_device *dev)
drm_property_create_range(dev, 0, "underscan vborder", 0, 128); drm_property_create_range(dev, 0, "underscan vborder", 0, 128);
if (gen >= 1) { if (gen >= 1) {
/* -90..+90 */
disp->vibrant_hue_property = disp->vibrant_hue_property =
drm_property_create(dev, DRM_MODE_PROP_RANGE, drm_property_create_range(dev, 0, "vibrant hue", 0, 180);
"vibrant hue", 2);
disp->vibrant_hue_property->values[0] = 0;
disp->vibrant_hue_property->values[1] = 180; /* -90..+90 */
/* -100..+100 */
disp->color_vibrance_property = disp->color_vibrance_property =
drm_property_create(dev, DRM_MODE_PROP_RANGE, drm_property_create_range(dev, 0, "color vibrance", 0, 200);
"color vibrance", 2);
disp->color_vibrance_property->values[0] = 0;
disp->color_vibrance_property->values[1] = 200; /* -100..+100 */
} }
dev->mode_config.funcs = &nouveau_mode_config_funcs; dev->mode_config.funcs = &nouveau_mode_config_funcs;
......
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