From: Marcin Slusarz Date: Sun, 27 Jan 2013 16:13:52 +0000 (+0100) Subject: drm/nouveau: handle backlight_device_register failure X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b795016cd2c6aebfa40cbccb3bad4e0325815fb4;p=openwrt%2Fstaging%2Fblogic.git drm/nouveau: handle backlight_device_register failure Found by smatch. Signed-off-by: Marcin Slusarz Signed-off-by: Ben Skeggs --- 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);