mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 00:48:50 +00:00
[media] adv7604: Check v4l2_of_parse_endpoint() return value
The v4l2_of_parse_endpoint() function can fail so check the return value. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
f7842cfd3c
commit
7f6cd6c40d
1 changed files with 6 additions and 1 deletions
|
@ -2820,6 +2820,7 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
|
|||
struct device_node *endpoint;
|
||||
struct device_node *np;
|
||||
unsigned int flags;
|
||||
int ret;
|
||||
u32 v;
|
||||
|
||||
np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node;
|
||||
|
@ -2829,7 +2830,11 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
|
|||
if (!endpoint)
|
||||
return -EINVAL;
|
||||
|
||||
v4l2_of_parse_endpoint(endpoint, &bus_cfg);
|
||||
ret = v4l2_of_parse_endpoint(endpoint, &bus_cfg);
|
||||
if (ret) {
|
||||
of_node_put(endpoint);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!of_property_read_u32(endpoint, "default-input", &v))
|
||||
state->pdata.default_input = v;
|
||||
|
|
Loading…
Reference in a new issue