From: Sachin Kamat <sachin.kamat@linaro.org>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: linux-media@vger.kernel.org, patches@linaro.org
Subject: Re: [PATCH 3/3] [media] exynos4-is: Fix potential NULL pointer dereference
Date: Fri, 2 Aug 2013 14:34:07 +0530 [thread overview]
Message-ID: <CAK9yfHwiF4F6edafkwtogUFwAtWm3-My=UEhgARez9eksngwuA@mail.gmail.com> (raw)
In-Reply-To: <51FB71B3.5060008@samsung.com>
Hi Sylwester,
On 2 August 2013 14:15, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote:
> 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.
OK. Sounds good. I will re-spin this one.
--
With warm regards,
Sachin
prev parent reply other threads:[~2013-08-02 9:04 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
2013-08-02 9:04 ` Sachin Kamat [this message]
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='CAK9yfHwiF4F6edafkwtogUFwAtWm3-My=UEhgARez9eksngwuA@mail.gmail.com' \
--to=sachin.kamat@linaro.org \
--cc=linux-media@vger.kernel.org \
--cc=patches@linaro.org \
--cc=s.nawrocki@samsung.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).