[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdbRR2aVM3L=NfFWQQVwBvh8ndLsXxafKZCza=z5RPzOzg@mail.gmail.com>
Date: Fri, 30 Aug 2013 09:29:29 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: frowand.list@...il.com
Cc: Grant Likely <grant.likely@...aro.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Bird, Tim" <tim.bird@...ymobile.com>
Subject: Re: [PATCH] gpio: null pointer dereference in error handling in gpiolib.c
On Fri, Aug 30, 2013 at 7:10 AM, Frank Rowand
<frank.rowand@...ymobile.com> wrote:
> Avoid calling desc_to_gpio() if desc->chip is NULL, as this will
> cause a kernel panic.
>
> In the code above the calls, there is a test for !chip, which
> comes to the 'fail' label if true. In this case, the code
> panics, since desc_to_gpio() uses desc->chip to look up the
> gpio number.
>
> An RFC patch that explained the cause of one example of panic when
> desc->chip is NULL and fixed that example
> (http://lkml.indiana.edu/hypermail/linux/kernel/1308.3/01473.html)
> was accepted. This patch fixes the remaining locations which have
> the same problem.
>
> Signed-off-by: Frank Rowand <frank.rowand@...ymobile.com>
Hm it appears Alexandre has another idea on how it should be
fixed, but he was in a hurry and didn't provide a proper patch.
Let me cook something up so we can see of we can get
this right.
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists