mirror of
https://github.com/torvalds/linux.git
synced 2024-11-08 21:21:47 +00:00
drm/nouveau: handle backlight_device_register failure
Found by smatch. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
a441dbb1d6
commit
b795016cd2
@ -84,6 +84,8 @@ nv40_backlight_init(struct drm_connector *connector)
|
||||
props.max_brightness = 31;
|
||||
bd = backlight_device_register("nv_backlight", &connector->kdev, drm,
|
||||
&nv40_bl_ops, &props);
|
||||
if (IS_ERR(bd))
|
||||
return PTR_ERR(bd);
|
||||
drm->backlight = bd;
|
||||
bd->props.brightness = nv40_get_intensity(bd);
|
||||
backlight_update_status(bd);
|
||||
|
Loading…
Reference in New Issue
Block a user