Skip to content

Commit

Permalink
drm/nouveau: use drm_property_create_range helper
Browse files Browse the repository at this point in the history
Avoids potential null pointer dereference.

Signed-off-by: Marcin Slusarz <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
  • Loading branch information
mslusarz authored and Ben Skeggs committed Feb 20, 2013
1 parent b5d8f05 commit 03e9a04
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/gpu/drm/nouveau/nouveau_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,13 @@ nouveau_display_create(struct drm_device *dev)
drm_property_create_range(dev, 0, "underscan vborder", 0, 128);

if (gen >= 1) {
/* -90..+90 */
disp->vibrant_hue_property =
drm_property_create(dev, DRM_MODE_PROP_RANGE,
"vibrant hue", 2);
disp->vibrant_hue_property->values[0] = 0;
disp->vibrant_hue_property->values[1] = 180; /* -90..+90 */
drm_property_create_range(dev, 0, "vibrant hue", 0, 180);

/* -100..+100 */
disp->color_vibrance_property =
drm_property_create(dev, DRM_MODE_PROP_RANGE,
"color vibrance", 2);
disp->color_vibrance_property->values[0] = 0;
disp->color_vibrance_property->values[1] = 200; /* -100..+100 */
drm_property_create_range(dev, 0, "color vibrance", 0, 200);
}

dev->mode_config.funcs = &nouveau_mode_config_funcs;
Expand Down

0 comments on commit 03e9a04

Please sign in to comment.