public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Obsolete Bug in file drivers/mfd/pcf50633-core.c
       [not found] <CAPDOMVj1C=ELSrV7fT0PdW+Kxpu6CN+y3TNzbfhH1rzt7uLGnA@mail.gmail.com>
@ 2014-06-23  8:47 ` Lee Jones
  2014-06-25  2:32   ` Nick Krause
  0 siblings, 1 reply; 2+ messages in thread
From: Lee Jones @ 2014-06-23  8:47 UTC (permalink / raw)
  To: Nick Krause; +Cc: sameo, linux-kernel

On Fri, 20 Jun 2014, Nick Krause wrote:
> There seems to be a obsolete bug in this file that has been reported about
> a NULL
> check for  platform_device_add_data() in function pcf50633_probe(). This
> bug seems
> to be fixed by the lines I wrote in my comment on Bugzilla. The attached
> link should
> give you an idea of if closing this bug is a good idea.
>  https://bugzilla.kernel.org/show_bug.cgi?id=78521
> <https://bugzilla.kernel.org/show_bug.cgi?id=78521>
> Thanks Nick

This bug was fixed by Alan Cox 2 years ago:

commit 18273c5b463d9f98ef81f1a6217a7f4168dd809a
Author: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date:   Fri Jul 13 16:43:32 2012 +0100

    mfd: Add missing out of memory check for pcf50633
    
    Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44561
    Reported-by: <rucsoftsec@gmail.com>
    Cc: Lars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index 29c122b..45ce1fb 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -253,8 +253,13 @@ static int __devinit pcf50633_probe(struct i2c_client *client,
                }
 
                pdev->dev.parent = pcf->dev;
-               platform_device_add_data(pdev, &pdata->reg_init_data[i],
-                                       sizeof(pdata->reg_init_data[i]));
+               if (platform_device_add_data(pdev, &pdata->reg_init_data[i],
+                                       sizeof(pdata->reg_init_data[i])) < 0) {
+                       platform_device_put(pdev);
+                       dev_err(pcf->dev, "Out of memory for regulator parameters %d\n",
+                                                                       i);
+                       continue;
+               }
                pcf->regulator_pdev[i] = pdev;
 
                platform_device_add(pdev);


-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: Obsolete Bug in file drivers/mfd/pcf50633-core.c
  2014-06-23  8:47 ` Obsolete Bug in file drivers/mfd/pcf50633-core.c Lee Jones
@ 2014-06-25  2:32   ` Nick Krause
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Krause @ 2014-06-25  2:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: sameo, linux-kernel@vger.kernel.org

Thanks Lee Jones ,
It's great to known that people are happy to clean up the
fixed bugs still open on Bugzilla.
Cheers Nick


On Mon, Jun 23, 2014 at 4:47 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On Fri, 20 Jun 2014, Nick Krause wrote:
>> There seems to be a obsolete bug in this file that has been reported about
>> a NULL
>> check for  platform_device_add_data() in function pcf50633_probe(). This
>> bug seems
>> to be fixed by the lines I wrote in my comment on Bugzilla. The attached
>> link should
>> give you an idea of if closing this bug is a good idea.
>>  https://bugzilla.kernel.org/show_bug.cgi?id=78521
>> <https://bugzilla.kernel.org/show_bug.cgi?id=78521>
>> Thanks Nick
>
> This bug was fixed by Alan Cox 2 years ago:
>
> commit 18273c5b463d9f98ef81f1a6217a7f4168dd809a
> Author: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Date:   Fri Jul 13 16:43:32 2012 +0100
>
>     mfd: Add missing out of memory check for pcf50633
>
>     Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44561
>     Reported-by: <rucsoftsec@gmail.com>
>     Cc: Lars-Peter Clausen <lars@metafoo.de>
>     Signed-off-by: Alan Cox <alan@linux.intel.com>
>     Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
>
> diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
> index 29c122b..45ce1fb 100644
> --- a/drivers/mfd/pcf50633-core.c
> +++ b/drivers/mfd/pcf50633-core.c
> @@ -253,8 +253,13 @@ static int __devinit pcf50633_probe(struct i2c_client *client,
>                 }
>
>                 pdev->dev.parent = pcf->dev;
> -               platform_device_add_data(pdev, &pdata->reg_init_data[i],
> -                                       sizeof(pdata->reg_init_data[i]));
> +               if (platform_device_add_data(pdev, &pdata->reg_init_data[i],
> +                                       sizeof(pdata->reg_init_data[i])) < 0) {
> +                       platform_device_put(pdev);
> +                       dev_err(pcf->dev, "Out of memory for regulator parameters %d\n",
> +                                                                       i);
> +                       continue;
> +               }
>                 pcf->regulator_pdev[i] = pdev;
>
>                 platform_device_add(pdev);
>
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2014-06-25  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAPDOMVj1C=ELSrV7fT0PdW+Kxpu6CN+y3TNzbfhH1rzt7uLGnA@mail.gmail.com>
2014-06-23  8:47 ` Obsolete Bug in file drivers/mfd/pcf50633-core.c Lee Jones
2014-06-25  2:32   ` Nick Krause

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