summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_backlight.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2013-01-27 17:13:52 +0100
committerBen Skeggs <bskeggs@redhat.com>2013-02-20 16:00:39 +1000
commitb795016cd2c6aebfa40cbccb3bad4e0325815fb4 (patch)
treef2a0222b629b5ac8f1268647193fb6179d9335ba /drivers/gpu/drm/nouveau/nouveau_backlight.c
parenta441dbb1d674b5696e3a27a95e72988f35236c9f (diff)
downloadblackbird-op-linux-b795016cd2c6aebfa40cbccb3bad4e0325815fb4.tar.gz
blackbird-op-linux-b795016cd2c6aebfa40cbccb3bad4e0325815fb4.zip
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>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_backlight.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_backlight.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index f65b20a375f6..5d940302d2aa 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -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);
OpenPOWER on IntegriCloud