* [PATCH 1/1] [media] exynos4-is: Fix potential null pointer dereference in mipi-csis.c
@ 2013-04-26 4:44 Sachin Kamat
2013-04-26 8:52 ` Sylwester Nawrocki
0 siblings, 1 reply; 3+ messages in thread
From: Sachin Kamat @ 2013-04-26 4:44 UTC (permalink / raw)
To: linux-media; +Cc: s.nawrocki, sachin.kamat, patches
When 'node' is NULL, the print statement tries to dereference it.
Remove it from the error message.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
drivers/media/platform/exynos4-is/mipi-csis.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c
index a2eda9d..6ddc69f 100644
--- a/drivers/media/platform/exynos4-is/mipi-csis.c
+++ b/drivers/media/platform/exynos4-is/mipi-csis.c
@@ -745,8 +745,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
node = v4l2_of_get_next_endpoint(node, NULL);
if (!node) {
- dev_err(&pdev->dev, "No port node at %s\n",
- node->full_name);
+ dev_err(&pdev->dev, "Port node not available\n");
return -EINVAL;
}
/* Get port node and validate MIPI-CSI channel id. */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 1/1] [media] exynos4-is: Fix potential null pointer dereference in mipi-csis.c
2013-04-26 4:44 [PATCH 1/1] [media] exynos4-is: Fix potential null pointer dereference in mipi-csis.c Sachin Kamat
@ 2013-04-26 8:52 ` Sylwester Nawrocki
2013-04-26 8:57 ` Sachin Kamat
0 siblings, 1 reply; 3+ messages in thread
From: Sylwester Nawrocki @ 2013-04-26 8:52 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-media, patches
On 04/26/2013 06:44 AM, Sachin Kamat wrote:
> When 'node' is NULL, the print statement tries to dereference it.
> Remove it from the error message.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/media/platform/exynos4-is/mipi-csis.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c
> index a2eda9d..6ddc69f 100644
> --- a/drivers/media/platform/exynos4-is/mipi-csis.c
> +++ b/drivers/media/platform/exynos4-is/mipi-csis.c
> @@ -745,8 +745,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
>
> node = v4l2_of_get_next_endpoint(node, NULL);
> if (!node) {
> - dev_err(&pdev->dev, "No port node at %s\n",
> - node->full_name);
> + dev_err(&pdev->dev, "Port node not available\n");
Thanks Sachin. Could you instead do
s/node->full_name/pdev->dev.of_node->full_name ?
This way we won't loose any information and it would be easier to
determine which node exactly is wrong.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/1] [media] exynos4-is: Fix potential null pointer dereference in mipi-csis.c
2013-04-26 8:52 ` Sylwester Nawrocki
@ 2013-04-26 8:57 ` Sachin Kamat
0 siblings, 0 replies; 3+ messages in thread
From: Sachin Kamat @ 2013-04-26 8:57 UTC (permalink / raw)
To: Sylwester Nawrocki; +Cc: linux-media, patches
Hi Sylwester,
On 26 April 2013 14:22, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote:
> On 04/26/2013 06:44 AM, Sachin Kamat wrote:
>> When 'node' is NULL, the print statement tries to dereference it.
>> Remove it from the error message.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> ---
>> drivers/media/platform/exynos4-is/mipi-csis.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c
>> index a2eda9d..6ddc69f 100644
>> --- a/drivers/media/platform/exynos4-is/mipi-csis.c
>> +++ b/drivers/media/platform/exynos4-is/mipi-csis.c
>> @@ -745,8 +745,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
>>
>> node = v4l2_of_get_next_endpoint(node, NULL);
>> if (!node) {
>> - dev_err(&pdev->dev, "No port node at %s\n",
>> - node->full_name);
>> + dev_err(&pdev->dev, "Port node not available\n");
>
> Thanks Sachin. Could you instead do
> s/node->full_name/pdev->dev.of_node->full_name ?
>
> This way we won't loose any information and it would be easier to
> determine which node exactly is wrong.
Certainly. I too wanted to provide this information in print message
but could not think of an alternative way
immediately. Thanks for the tip.
--
With warm regards,
Sachin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-26 8:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-26 4:44 [PATCH 1/1] [media] exynos4-is: Fix potential null pointer dereference in mipi-csis.c Sachin Kamat
2013-04-26 8:52 ` Sylwester Nawrocki
2013-04-26 8:57 ` Sachin Kamat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox