Commit b795016c authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ben Skeggs

drm/nouveau: handle backlight_device_register failure

Found by smatch.
Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent a441dbb1
...@@ -84,6 +84,8 @@ nv40_backlight_init(struct drm_connector *connector) ...@@ -84,6 +84,8 @@ nv40_backlight_init(struct drm_connector *connector)
props.max_brightness = 31; props.max_brightness = 31;
bd = backlight_device_register("nv_backlight", &connector->kdev, drm, bd = backlight_device_register("nv_backlight", &connector->kdev, drm,
&nv40_bl_ops, &props); &nv40_bl_ops, &props);
if (IS_ERR(bd))
return PTR_ERR(bd);
drm->backlight = bd; drm->backlight = bd;
bd->props.brightness = nv40_get_intensity(bd); bd->props.brightness = nv40_get_intensity(bd);
backlight_update_status(bd); backlight_update_status(bd);
......
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