From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: linux-media@vger.kernel.org, patches@linaro.org
Subject: Re: [PATCH 3/3] [media] exynos4-is: Fix potential NULL pointer dereference
Date: Fri, 02 Aug 2013 10:45:39 +0200 [thread overview]
Message-ID: <51FB71B3.5060008@samsung.com> (raw)
In-Reply-To: <1375425134-17080-3-git-send-email-sachin.kamat@linaro.org>
Hi Sachin,
On 08/02/2013 08:32 AM, Sachin Kamat wrote:
> dev->of_node could be NULL. Hence check for the same and return before
> dereferencing it in the subsequent error message.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/media/platform/exynos4-is/fimc-lite.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
> index 08fbfed..214bde2 100644
> --- a/drivers/media/platform/exynos4-is/fimc-lite.c
> +++ b/drivers/media/platform/exynos4-is/fimc-lite.c
> @@ -1513,6 +1513,9 @@ static int fimc_lite_probe(struct platform_device *pdev)
> if (of_id)
> drv_data = (struct flite_drvdata *)of_id->data;
> fimc->index = of_alias_get_id(dev->of_node, "fimc-lite");
> + } else {
> + dev_err(dev, "device node not found\n");
> + return -EINVAL;
> }
Thanks for the patch. I would prefer to add a check at very beginning
of fimc_lite_probe() like:
if (!dev->of_node)
return -ENODEV;
Those devices are only used on DT platforms.
--
Regards,
Sylwester
next prev parent reply other threads:[~2013-08-02 8:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-02 6:32 [PATCH 1/3] [media] exynos4-is: Staticize local symbol Sachin Kamat
2013-08-02 6:32 ` [PATCH 2/3] [media] exynos4-is: Annotate unused functions Sachin Kamat
2013-08-05 5:12 ` Sachin Kamat
2013-08-05 11:05 ` Sylwester Nawrocki
2013-08-05 11:35 ` Sachin Kamat
2013-08-02 6:32 ` [PATCH 3/3] [media] exynos4-is: Fix potential NULL pointer dereference Sachin Kamat
2013-08-02 8:45 ` Sylwester Nawrocki [this message]
2013-08-02 9:04 ` Sachin Kamat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51FB71B3.5060008@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=linux-media@vger.kernel.org \
--cc=patches@linaro.org \
--cc=sachin.kamat@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.