diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2013-01-27 17:13:52 +0100 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-02-20 16:00:39 +1000 |
commit | b795016cd2c6aebfa40cbccb3bad4e0325815fb4 (patch) | |
tree | f2a0222b629b5ac8f1268647193fb6179d9335ba /drivers/gpu/drm/nouveau/nouveau_backlight.c | |
parent | a441dbb1d674b5696e3a27a95e72988f35236c9f (diff) | |
download | blackbird-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.c | 2 |
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); |