summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/ssd1307fb.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-05-23 19:32:35 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-05-27 11:54:46 +0200
commitc2b00024bc6f3408b0facc87227383e633131900 (patch)
tree51a58dc1f284aba81bbc1083365d0c25978da159 /drivers/video/fbdev/ssd1307fb.c
parentfbdev: ssd1307fb: Add blank mode (diff)
downloadlinux-c2b00024bc6f3408b0facc87227383e633131900.tar.xz
linux-c2b00024bc6f3408b0facc87227383e633131900.zip
fbdev: ssd1307fb: potential ERR_PTR dereference
The error handling got shifted down a few lines from where it was supposed to be for some reason. Fixes: a14a7ba8cb0f ('fbdev: ssd1307fb: add backlight controls for setting the contrast') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/fbdev/ssd1307fb.c')
-rw-r--r--drivers/video/fbdev/ssd1307fb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index 8fc224c99032..9c28a77c2934 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -655,15 +655,16 @@ static int ssd1307fb_probe(struct i2c_client *client,
snprintf(bl_name, sizeof(bl_name), "ssd1307fb%d", info->node);
bl = backlight_device_register(bl_name, &client->dev, par,
&ssd1307fb_bl_ops, NULL);
- bl->props.brightness = par->contrast;
- bl->props.max_brightness = MAX_CONTRAST;
- info->bl_dev = bl;
-
if (IS_ERR(bl)) {
dev_err(&client->dev, "unable to register backlight device: %ld\n",
PTR_ERR(bl));
goto bl_init_error;
}
+
+ bl->props.brightness = par->contrast;
+ bl->props.max_brightness = MAX_CONTRAST;
+ info->bl_dev = bl;
+
dev_info(&client->dev, "fb%d: %s framebuffer device registered, using %d bytes of video memory\n", info->node, info->fix.id, vmem_size);
return 0;