public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFT 1/2] [media] exynos4-is: Add missing endpoint of_node_put on error paths
@ 2016-01-26  0:41 Krzysztof Kozlowski
  2016-01-26  0:41 ` [RFT 2/2] [media] exynos4-is: Add missing port parent " Krzysztof Kozlowski
  2016-03-07 14:15 ` [RFT 1/2] [media] exynos4-is: Add missing endpoint " Javier Martinez Canillas
  0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2016-01-26  0:41 UTC (permalink / raw)
  To: Kyungmin Park, Sylwester Nawrocki, Mauro Carvalho Chehab,
	Kukjin Kim, Krzysztof Kozlowski, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel
  Cc: Javier Martinez Canillas

In fimc_md_parse_port_node() endpoint node is get with of_get_next_child()
but it is not put on error path.

Fixes: 56fa1a6a6a7d ("[media] s5p-fimc: Change the driver directory name to exynos4-is")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

---

Not tested on hardware, only built+static checkers.
---
 drivers/media/platform/exynos4-is/media-dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
index f3b2dd30ec77..de0977479327 100644
--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -339,8 +339,10 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd,
 		return 0;
 
 	v4l2_of_parse_endpoint(ep, &endpoint);
-	if (WARN_ON(endpoint.base.port == 0) || index >= FIMC_MAX_SENSORS)
+	if (WARN_ON(endpoint.base.port == 0) || index >= FIMC_MAX_SENSORS) {
+		of_node_put(ep);
 		return -EINVAL;
+	}
 
 	pd->mux_id = (endpoint.base.port - 1) & 0x1;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [RFT 2/2] [media] exynos4-is: Add missing port parent of_node_put on error paths
  2016-01-26  0:41 [RFT 1/2] [media] exynos4-is: Add missing endpoint of_node_put on error paths Krzysztof Kozlowski
@ 2016-01-26  0:41 ` Krzysztof Kozlowski
  2016-03-07 14:17   ` Javier Martinez Canillas
  2016-03-07 14:15 ` [RFT 1/2] [media] exynos4-is: Add missing endpoint " Javier Martinez Canillas
  1 sibling, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2016-01-26  0:41 UTC (permalink / raw)
  To: Kyungmin Park, Sylwester Nawrocki, Mauro Carvalho Chehab,
	Kukjin Kim, Krzysztof Kozlowski, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel
  Cc: Javier Martinez Canillas

In fimc_md_parse_port_node() remote port parent node is get with
of_graph_get_remote_port_parent() but it is not put on error path.

Fixes: fa91f1056f17 ("[media] exynos4-is: Add support for asynchronous subdevices registration")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

---

Not tested on hardware, only built+static checkers.
---
 drivers/media/platform/exynos4-is/media-dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
index de0977479327..d2e564878e06 100644
--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -385,8 +385,10 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd,
 	else
 		pd->fimc_bus_type = pd->sensor_bus_type;
 
-	if (WARN_ON(index >= ARRAY_SIZE(fmd->sensor)))
+	if (WARN_ON(index >= ARRAY_SIZE(fmd->sensor))) {
+		of_node_put(rem);
 		return -EINVAL;
+	}
 
 	fmd->sensor[index].asd.match_type = V4L2_ASYNC_MATCH_OF;
 	fmd->sensor[index].asd.match.of.node = rem;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFT 1/2] [media] exynos4-is: Add missing endpoint of_node_put on error paths
  2016-01-26  0:41 [RFT 1/2] [media] exynos4-is: Add missing endpoint of_node_put on error paths Krzysztof Kozlowski
  2016-01-26  0:41 ` [RFT 2/2] [media] exynos4-is: Add missing port parent " Krzysztof Kozlowski
@ 2016-03-07 14:15 ` Javier Martinez Canillas
  1 sibling, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2016-03-07 14:15 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Kyungmin Park, Sylwester Nawrocki,
	Mauro Carvalho Chehab, Kukjin Kim, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Hello Krzysztof,

On 01/25/2016 09:41 PM, Krzysztof Kozlowski wrote:
> In fimc_md_parse_port_node() endpoint node is get with of_get_next_child()
> but it is not put on error path.
> 
> Fixes: 56fa1a6a6a7d ("[media] s5p-fimc: Change the driver directory name to exynos4-is")
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> 
> ---
> 
> Not tested on hardware, only built+static checkers.
> ---
>  drivers/media/platform/exynos4-is/media-dev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
> index f3b2dd30ec77..de0977479327 100644
> --- a/drivers/media/platform/exynos4-is/media-dev.c
> +++ b/drivers/media/platform/exynos4-is/media-dev.c
> @@ -339,8 +339,10 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd,
>  		return 0;
>  
>  	v4l2_of_parse_endpoint(ep, &endpoint);
> -	if (WARN_ON(endpoint.base.port == 0) || index >= FIMC_MAX_SENSORS)
> +	if (WARN_ON(endpoint.base.port == 0) || index >= FIMC_MAX_SENSORS) {
> +		of_node_put(ep);
>  		return -EINVAL;
> +	}
>  
>  	pd->mux_id = (endpoint.base.port - 1) & 0x1;
>  
> 

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFT 2/2] [media] exynos4-is: Add missing port parent of_node_put on error paths
  2016-01-26  0:41 ` [RFT 2/2] [media] exynos4-is: Add missing port parent " Krzysztof Kozlowski
@ 2016-03-07 14:17   ` Javier Martinez Canillas
  0 siblings, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2016-03-07 14:17 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Kyungmin Park, Sylwester Nawrocki,
	Mauro Carvalho Chehab, Kukjin Kim, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Hello Krzysztof,

On 01/25/2016 09:41 PM, Krzysztof Kozlowski wrote:
> In fimc_md_parse_port_node() remote port parent node is get with
> of_graph_get_remote_port_parent() but it is not put on error path.
> 
> Fixes: fa91f1056f17 ("[media] exynos4-is: Add support for asynchronous subdevices registration")
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> 
> ---
> 
> Not tested on hardware, only built+static checkers.
> ---
>  drivers/media/platform/exynos4-is/media-dev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
> index de0977479327..d2e564878e06 100644
> --- a/drivers/media/platform/exynos4-is/media-dev.c
> +++ b/drivers/media/platform/exynos4-is/media-dev.c
> @@ -385,8 +385,10 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd,
>  	else
>  		pd->fimc_bus_type = pd->sensor_bus_type;
>  
> -	if (WARN_ON(index >= ARRAY_SIZE(fmd->sensor)))
> +	if (WARN_ON(index >= ARRAY_SIZE(fmd->sensor))) {
> +		of_node_put(rem);
>  		return -EINVAL;
> +	}
>  
>  	fmd->sensor[index].asd.match_type = V4L2_ASYNC_MATCH_OF;
>  	fmd->sensor[index].asd.match.of.node = rem;
> 

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-07 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-26  0:41 [RFT 1/2] [media] exynos4-is: Add missing endpoint of_node_put on error paths Krzysztof Kozlowski
2016-01-26  0:41 ` [RFT 2/2] [media] exynos4-is: Add missing port parent " Krzysztof Kozlowski
2016-03-07 14:17   ` Javier Martinez Canillas
2016-03-07 14:15 ` [RFT 1/2] [media] exynos4-is: Add missing endpoint " Javier Martinez Canillas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox