From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-fbdev@vger.kernel.org
Subject: re: backlight: Add pcf50633 backlight driver
Date: Wed, 01 Feb 2012 09:42:54 +0000 [thread overview]
Message-ID: <20120201094254.GA24044@elgon.mountain> (raw)
Hello Lars-Peter Clausen,
This is a semi-automatic email about new static checker warnings.
The patch 2ddfd12f3584: "backlight: Add pcf50633 backlight driver"
from May 12, 2010, leads to the following Smatch complaint:
drivers/video/backlight/pcf50633-backlight.c +136 pcf50633_bl_probe()
error: we previously assumed 'pdata' could be null (see line 118)
drivers/video/backlight/pcf50633-backlight.c
117
118 if (pdata) {
^^^^^
check.
119 bl_props.brightness = pdata->default_brightness;
120 pcf_bl->brightness_limit = pdata->default_brightness_limit;
121 } else {
122 bl_props.brightness = 0x3f;
123 pcf_bl->brightness_limit = 0x3f;
124 }
125
126 pcf_bl->pcf = dev_to_pcf50633(pdev->dev.parent);
127
128 pcf_bl->bl = backlight_device_register(pdev->name, &pdev->dev, pcf_bl,
129 &pcf50633_bl_ops, &bl_props);
130
131 if (IS_ERR(pcf_bl->bl))
132 return PTR_ERR(pcf_bl->bl);
133
134 platform_set_drvdata(pdev, pcf_bl);
135
136 pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDDIM, pdata->ramp_time);
^^^^^^^^^^^^^^^^
dereference with checking.
137
138 /* Should be different from bl_props.brightness, so we do not exit
regards,
dan carpenter
reply other threads:[~2012-02-01 9:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120201094254.GA24044@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=linux-fbdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).