* [patch] fbdev: ssd1307fb: potential ERR_PTR dereference
@ 2015-05-23 17:32 Dan Carpenter
2015-05-24 7:19 ` Maxime Ripard
2015-05-25 5:40 ` Tomi Valkeinen
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-05-23 17:32 UTC (permalink / raw)
To: linux-fbdev
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>
diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index 8fc224c..9c28a77 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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch] fbdev: ssd1307fb: potential ERR_PTR dereference
2015-05-23 17:32 [patch] fbdev: ssd1307fb: potential ERR_PTR dereference Dan Carpenter
@ 2015-05-24 7:19 ` Maxime Ripard
2015-05-25 5:40 ` Tomi Valkeinen
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2015-05-24 7:19 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 518 bytes --]
On Sat, May 23, 2015 at 08:32:35PM +0300, Dan Carpenter wrote:
> 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>
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] fbdev: ssd1307fb: potential ERR_PTR dereference
2015-05-23 17:32 [patch] fbdev: ssd1307fb: potential ERR_PTR dereference Dan Carpenter
2015-05-24 7:19 ` Maxime Ripard
@ 2015-05-25 5:40 ` Tomi Valkeinen
1 sibling, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2015-05-25 5:40 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]
On 23/05/15 20:32, Dan Carpenter wrote:
> 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>
>
> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> index 8fc224c..9c28a77 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;
>
Thanks, queued for 4.2.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-25 5:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-23 17:32 [patch] fbdev: ssd1307fb: potential ERR_PTR dereference Dan Carpenter
2015-05-24 7:19 ` Maxime Ripard
2015-05-25 5:40 ` Tomi Valkeinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).