From: Javier Martinez Canillas Date: Mon, 11 Jan 2016 16:47:12 +0000 (-0200) Subject: [media] s5k5baf: Check v4l2_of_parse_endpoint() return value X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2388309c7480550e64e20221640f6a5c717be662;p=linux-beck.git [media] s5k5baf: 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/s5k5baf.c b/drivers/media/i2c/s5k5baf.c index fc3a5a8e6c9c..db82ed05792e 100644 --- a/drivers/media/i2c/s5k5baf.c +++ b/drivers/media/i2c/s5k5baf.c @@ -1868,8 +1868,11 @@ static int s5k5baf_parse_device_node(struct s5k5baf *state, struct device *dev) return -EINVAL; } - v4l2_of_parse_endpoint(node_ep, &ep); + ret = v4l2_of_parse_endpoint(node_ep, &ep); of_node_put(node_ep); + if (ret) + return ret; + state->bus_type = ep.bus_type; switch (state->bus_type) {