* [PATCH] mt9v032: fix uninitialized variable warning
@ 2015-07-28 8:33 Hans Verkuil
0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2015-07-28 8:33 UTC (permalink / raw)
To: Linux Media Mailing List
drivers/media/i2c/mt9v032.c: In function ‘mt9v032_probe’:
CC [M] drivers/media/i2c/s5k4ecgx.o
drivers/media/i2c/mt9v032.c:996:20: warning: ‘pdata’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (pdata && pdata->link_freqs) {
^
It can indeed be uninitialized in one corner case. Initialize to NULL.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
drivers/media/i2c/mt9v032.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
index 977f400..a68ce94 100644
--- a/drivers/media/i2c/mt9v032.c
+++ b/drivers/media/i2c/mt9v032.c
@@ -882,7 +882,7 @@ static const struct regmap_config mt9v032_regmap_config = {
static struct mt9v032_platform_data *
mt9v032_get_pdata(struct i2c_client *client)
{
- struct mt9v032_platform_data *pdata;
+ struct mt9v032_platform_data *pdata = NULL;
struct v4l2_of_endpoint endpoint;
struct device_node *np;
struct property *prop;
--
2.1.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-28 8:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28 8:33 [PATCH] mt9v032: fix uninitialized variable warning Hans Verkuil
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).