提交 baf40b5f 编写于 作者: J Javier Martinez Canillas 提交者: Mauro Carvalho Chehab

[media] tvp7002: Check v4l2_of_parse_endpoint() return value

The v4l2_of_parse_endpoint() function can fail so check the return value.
Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com>
Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: NLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 fe1e6ac6
...@@ -894,7 +894,7 @@ static struct tvp7002_config * ...@@ -894,7 +894,7 @@ static struct tvp7002_config *
tvp7002_get_pdata(struct i2c_client *client) tvp7002_get_pdata(struct i2c_client *client)
{ {
struct v4l2_of_endpoint bus_cfg; struct v4l2_of_endpoint bus_cfg;
struct tvp7002_config *pdata; struct tvp7002_config *pdata = NULL;
struct device_node *endpoint; struct device_node *endpoint;
unsigned int flags; unsigned int flags;
...@@ -905,11 +905,13 @@ tvp7002_get_pdata(struct i2c_client *client) ...@@ -905,11 +905,13 @@ tvp7002_get_pdata(struct i2c_client *client)
if (!endpoint) if (!endpoint)
return NULL; return NULL;
if (v4l2_of_parse_endpoint(endpoint, &bus_cfg))
goto done;
pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL); pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) if (!pdata)
goto done; goto done;
v4l2_of_parse_endpoint(endpoint, &bus_cfg);
flags = bus_cfg.bus.parallel.flags; flags = bus_cfg.bus.parallel.flags;
if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册