Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1324737 > unrolled thread

Re: [PATCH] davinci:Fix possible NULL pointer deference in the function davinci_gpio_probe

Started byAlexandre Courbot <gnurou@gmail.com>
First post2016-02-03 00:40 +0100
Last post2016-02-03 01:30 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] davinci:Fix possible NULL pointer deference in the  function davinci_gpio_probe Alexandre Courbot <gnurou@gmail.com> - 2016-02-03 00:40 +0100
    Re: [PATCH] davinci:Fix possible NULL pointer deference in the  function davinci_gpio_probe Alexandre Courbot <gnurou@gmail.com> - 2016-02-03 01:30 +0100

#1324737 — Re: [PATCH] davinci:Fix possible NULL pointer deference in the function davinci_gpio_probe

FromAlexandre Courbot <gnurou@gmail.com>
Date2016-02-03 00:40 +0100
SubjectRe: [PATCH] davinci:Fix possible NULL pointer deference in the function davinci_gpio_probe
Message-ID<qXSI9-29S-5@gated-at.bofh.it>
On Fri, Jan 29, 2016 at 6:04 AM, Nicholas Krause <xerofoify@gmail.com> wrote:
> This fixes a possible NULL pointer deference in the function,
> davinci_gpio_probe due to the function, gpio2regs being able
> to return a NULL pointer if it rans to get the registers for
> the gpio devices on a davinci board. Furthermore if this does
> arise return -ENXIO to signal callers that this case has arisen
> and avoiding setting the regs or other pointer values on the
> chips to avoid rather deferences to a NULL pointer by other
> functions in this gpio driver.
>
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  drivers/gpio/gpio-davinci.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
> index ec58f42..800227e 100644
> --- a/drivers/gpio/gpio-davinci.c
> +++ b/drivers/gpio/gpio-davinci.c
> @@ -257,6 +257,8 @@ static int davinci_gpio_probe(struct platform_device *pdev)
>                 spin_lock_init(&chips[i].lock);
>
>                 regs = gpio2regs(base);
> +               if (!ret)
> +                       return -ENXIO;

You haven't even tried to compile this one, have you?

[toc] | [next] | [standalone]


#1324763

FromAlexandre Courbot <gnurou@gmail.com>
Date2016-02-03 01:30 +0100
Message-ID<qXTuz-2P5-33@gated-at.bofh.it>
In reply to#1324737
On Wed, Feb 3, 2016 at 9:10 AM, nick <xerofoify@gmail.com> wrote:
>
>
> On 2016-02-02 06:30 PM, Alexandre Courbot wrote:
>> On Fri, Jan 29, 2016 at 6:04 AM, Nicholas Krause <xerofoify@gmail.com> wrote:
>>> This fixes a possible NULL pointer deference in the function,
>>> davinci_gpio_probe due to the function, gpio2regs being able
>>> to return a NULL pointer if it rans to get the registers for
>>> the gpio devices on a davinci board. Furthermore if this does
>>> arise return -ENXIO to signal callers that this case has arisen
>>> and avoiding setting the regs or other pointer values on the
>>> chips to avoid rather deferences to a NULL pointer by other
>>> functions in this gpio driver.
>>>
>>> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>>> ---
>>>  drivers/gpio/gpio-davinci.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
>>> index ec58f42..800227e 100644
>>> --- a/drivers/gpio/gpio-davinci.c
>>> +++ b/drivers/gpio/gpio-davinci.c
>>> @@ -257,6 +257,8 @@ static int davinci_gpio_probe(struct platform_device *pdev)
>>>                 spin_lock_init(&chips[i].lock);
>>>
>>>                 regs = gpio2regs(base);
>>> +               if (!ret)
>>> +                       return -ENXIO;
>>
>> You haven't even tried to compile this one, have you?
>>
> Weird my compiler didn't fail when building with allmodconfig on x86_64 unless this
> driver is not enabled by default under that build config it should have failed.
> Sorry about that Alexandre I will resend and fix up that build issue.

Davinci is ARM, so it will not be included in a x86 build.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web