Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1305384
| From | Sakari Ailus <sakari.ailus@iki.fi> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 6/8] [media] tvp7002: Check v4l2_of_parse_endpoint() return value |
| Date | 2016-01-10 00:10 +0100 |
| Message-ID | <qPaNX-41a-3@gated-at.bofh.it> (permalink) |
| References | <qOntU-3ug-3@gated-at.bofh.it> <qOnDA-3xV-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Javier, On Thu, Jan 07, 2016 at 03:27:20PM -0300, Javier Martinez Canillas wrote: > The v4l2_of_parse_endpoint() function can fail so check the return value. > > Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> > --- > > drivers/media/i2c/tvp7002.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c > index 83c79fa5f61d..4aac303da5d4 100644 > --- a/drivers/media/i2c/tvp7002.c > +++ b/drivers/media/i2c/tvp7002.c > @@ -905,11 +905,13 @@ tvp7002_get_pdata(struct i2c_client *client) > if (!endpoint) > return NULL; > > + if (v4l2_of_parse_endpoint(endpoint, &bus_cfg)) pdata is uninitialised here. There are many ways to fix this but I think I'd just assign it to NULL in variable declaration. > + goto done; > + > pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL); > if (!pdata) > goto done; > > - v4l2_of_parse_endpoint(endpoint, &bus_cfg); > flags = bus_cfg.bus.parallel.flags; > > if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) -- Kind regards, Sakari Ailus e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/8] [media] Check v4l2_of_parse_endpoint() ret val in all drivers Javier Martinez Canillas <javier@osg.samsung.com> - 2016-01-07 19:30 +0100
[PATCH 5/8] [media] tvp514x: Check v4l2_of_parse_endpoint() return value Javier Martinez Canillas <javier@osg.samsung.com> - 2016-01-07 19:30 +0100
Re: [PATCH 5/8] [media] tvp514x: Check v4l2_of_parse_endpoint() return value Sakari Ailus <sakari.ailus@iki.fi> - 2016-01-10 00:10 +0100
[PATCH 6/8] [media] tvp7002: Check v4l2_of_parse_endpoint() return value Javier Martinez Canillas <javier@osg.samsung.com> - 2016-01-07 19:40 +0100
Re: [PATCH 6/8] [media] tvp7002: Check v4l2_of_parse_endpoint() return value Sakari Ailus <sakari.ailus@iki.fi> - 2016-01-10 00:10 +0100
Re: [PATCH 0/8] [media] Check v4l2_of_parse_endpoint() ret val in all drivers Sakari Ailus <sakari.ailus@iki.fi> - 2016-01-10 00:10 +0100
Re: [PATCH 0/8] [media] Check v4l2_of_parse_endpoint() ret val in all drivers Javier Martinez Canillas <javier@osg.samsung.com> - 2016-01-11 17:50 +0100
csiph-web