* [PATCH] rtc: max8998: Check for pdata presence before dereferencing
@ 2013-05-15 15:16 Tomasz Figa
2013-05-15 16:12 ` Sachin Kamat
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tomasz Figa @ 2013-05-15 15:16 UTC (permalink / raw)
To: linux-arm-kernel
Currently the driver can crash with a NULL pointer dereference if no pdata
is provided, despite of successful registration of MFD part. This patch
fixes the problem by adding a NULL check before dereferencing the pdata
pointer.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/rtc/rtc-max8998.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-max8998.c b/drivers/rtc/rtc-max8998.c
index 48b6612..d5af7ba 100644
--- a/drivers/rtc/rtc-max8998.c
+++ b/drivers/rtc/rtc-max8998.c
@@ -285,7 +285,7 @@ static int max8998_rtc_probe(struct platform_device *pdev)
info->irq, ret);
dev_info(&pdev->dev, "RTC CHIP NAME: %s\n", pdev->id_entry->name);
- if (pdata->rtc_delay) {
+ if (pdata && pdata->rtc_delay) {
info->lp3974_bug_workaround = true;
dev_warn(&pdev->dev, "LP3974 with RTC REGERR option."
" RTC updates will be extremely slow.\n");
--
1.8.2.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] rtc: max8998: Check for pdata presence before dereferencing
2013-05-15 15:16 [PATCH] rtc: max8998: Check for pdata presence before dereferencing Tomasz Figa
@ 2013-05-15 16:12 ` Sachin Kamat
2013-05-20 20:05 ` Tomasz Figa
2013-05-23 23:55 ` [rtc-linux] " Andrew Morton
2 siblings, 0 replies; 4+ messages in thread
From: Sachin Kamat @ 2013-05-15 16:12 UTC (permalink / raw)
To: linux-arm-kernel
CCing Andrew Morton.
On 15 May 2013 20:46, Tomasz Figa <t.figa@samsung.com> wrote:
> Currently the driver can crash with a NULL pointer dereference if no pdata
> is provided, despite of successful registration of MFD part. This patch
> fixes the problem by adding a NULL check before dereferencing the pdata
> pointer.
>
> Signed-off-by: Tomasz Figa <t.figa@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/rtc/rtc-max8998.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-max8998.c b/drivers/rtc/rtc-max8998.c
> index 48b6612..d5af7ba 100644
> --- a/drivers/rtc/rtc-max8998.c
> +++ b/drivers/rtc/rtc-max8998.c
> @@ -285,7 +285,7 @@ static int max8998_rtc_probe(struct platform_device *pdev)
> info->irq, ret);
>
> dev_info(&pdev->dev, "RTC CHIP NAME: %s\n", pdev->id_entry->name);
> - if (pdata->rtc_delay) {
> + if (pdata && pdata->rtc_delay) {
> info->lp3974_bug_workaround = true;
> dev_warn(&pdev->dev, "LP3974 with RTC REGERR option."
> " RTC updates will be extremely slow.\n");
> --
> 1.8.2.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
With warm regards,
Sachin
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH] rtc: max8998: Check for pdata presence before dereferencing
2013-05-15 15:16 [PATCH] rtc: max8998: Check for pdata presence before dereferencing Tomasz Figa
2013-05-15 16:12 ` Sachin Kamat
@ 2013-05-20 20:05 ` Tomasz Figa
2013-05-23 23:55 ` [rtc-linux] " Andrew Morton
2 siblings, 0 replies; 4+ messages in thread
From: Tomasz Figa @ 2013-05-20 20:05 UTC (permalink / raw)
To: linux-arm-kernel
Hi Alessandro,
On Wednesday 15 of May 2013 17:16:08 Tomasz Figa wrote:
> Currently the driver can crash with a NULL pointer dereference if no
> pdata is provided, despite of successful registration of MFD part. This
> patch fixes the problem by adding a NULL check before dereferencing the
> pdata pointer.
>
> Signed-off-by: Tomasz Figa <t.figa@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/rtc/rtc-max8998.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-max8998.c b/drivers/rtc/rtc-max8998.c
> index 48b6612..d5af7ba 100644
> --- a/drivers/rtc/rtc-max8998.c
> +++ b/drivers/rtc/rtc-max8998.c
> @@ -285,7 +285,7 @@ static int max8998_rtc_probe(struct platform_device
> *pdev) info->irq, ret);
>
> dev_info(&pdev->dev, "RTC CHIP NAME: %s\n", pdev->id_entry->name);
> - if (pdata->rtc_delay) {
> + if (pdata && pdata->rtc_delay) {
> info->lp3974_bug_workaround = true;
> dev_warn(&pdev->dev, "LP3974 with RTC REGERR option."
> " RTC updates will be extremely slow.\n");
Since this is a fix, could you apply this patch to your fixes branch for
3.10-rc2, please?
Best regards,
Tomasz
^ permalink raw reply [flat|nested] 4+ messages in thread* [rtc-linux] [PATCH] rtc: max8998: Check for pdata presence before dereferencing
2013-05-15 15:16 [PATCH] rtc: max8998: Check for pdata presence before dereferencing Tomasz Figa
2013-05-15 16:12 ` Sachin Kamat
2013-05-20 20:05 ` Tomasz Figa
@ 2013-05-23 23:55 ` Andrew Morton
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2013-05-23 23:55 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, 15 May 2013 17:16:08 +0200 Tomasz Figa <t.figa@samsung.com> wrote:
> Currently the driver can crash with a NULL pointer dereference if no pdata
> is provided, despite of successful registration of MFD part. This patch
> fixes the problem by adding a NULL check before dereferencing the pdata
> pointer.
>
> ...
>
> --- a/drivers/rtc/rtc-max8998.c
> +++ b/drivers/rtc/rtc-max8998.c
> @@ -285,7 +285,7 @@ static int max8998_rtc_probe(struct platform_device *pdev)
> info->irq, ret);
>
> dev_info(&pdev->dev, "RTC CHIP NAME: %s\n", pdev->id_entry->name);
> - if (pdata->rtc_delay) {
> + if (pdata && pdata->rtc_delay) {
> info->lp3974_bug_workaround = true;
> dev_warn(&pdev->dev, "LP3974 with RTC REGERR option."
> " RTC updates will be extremely slow.\n");
Looking at your description I'm unable to determine which kernel
versions we should fix. This is because the changelog didn't describe
the circumstances under which the bug triggers.
It's pretty simple: when fixing a bug, include a full description of
the bug! As if you were sending a bug report, not a patch.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-05-23 23:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-15 15:16 [PATCH] rtc: max8998: Check for pdata presence before dereferencing Tomasz Figa
2013-05-15 16:12 ` Sachin Kamat
2013-05-20 20:05 ` Tomasz Figa
2013-05-23 23:55 ` [rtc-linux] " Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox