b/drivers/media/platform/exynos4-is/media-dev.c
@@ -385,38 +385,35 @@ static void fimc_md_pipelines_free(struct fimc_md
*fmd)
static int fimc_md_parse_port_node(struct fimc_md *fmd,
struct device_node *port,
unsigned int index)
{
struct fimc_source_info *pd = &fmd->sensor[index].pdata;
- struct device_node *rem, *ep, *np;
+ struct device_node *rem = NULL, *ep = NULL, *np;
struct v4l2_of_endpoint endpoint;
int ret;
/* Assume here a port node can have only one endpoint node. */
ep = of_get_next_child(port, NULL);
if (!ep)
return 0;
ret = v4l2_of_parse_endpoint(ep, &endpoint);
- if (ret) {
- of_node_put(ep);
- return ret;
- }
+ if (ret)
+ goto put_ep;
if (WARN_ON(endpoint.base.port == 0) || index >= FIMC_MAX_SENSORS) {
- of_node_put(ep);
- return -EINVAL;
+ ret = -EINVAL;
+ goto put_ep;
}
pd->mux_id = (endpoint.base.port - 1) & 0x1;
rem = of_graph_get_remote_port_parent(ep);
- of_node_put(ep);
if (rem == NULL) {
v4l2_info(&fmd->v4l2_dev, "Remote device at %s not found\n",
ep->full_name);
- return 0;
+ goto out;
}
if (fimc_input_is_parallel(endpoint.base.port)) {
if (endpoint.bus_type == V4L2_MBUS_PARALLEL)