From: Javier Martinez Canillas Date: Mon, 11 Jan 2016 16:47:10 +0000 (-0200) Subject: [media] adv7604: Check v4l2_of_parse_endpoint() return value X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7f6cd6c40d7bf3c640294359a8a835d03c94d634;p=openwrt%2Fstaging%2Fblogic.git [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 Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 5d4dbd05f9d6..801a9b09d5e5 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -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;