[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdY_ER-=ig=zeGNKaGFmVrrLrTqXPCJ+75F9eZZ9JOOmxA@mail.gmail.com>
Date: Mon, 13 Jul 2015 14:24:12 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Gregory Fong <gregory.0xf0@...il.com>
Cc: "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
Alexandre Courbot <gnurou@...il.com>,
bcm-kernel-feedback-list <bcm-kernel-feedback-list@...adcom.com>,
Brian Norris <computersforpeace@...il.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Florian Fainelli <f.fainelli@...il.com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Mark Rutland <mark.rutland@....com>,
Pawel Moll <pawel.moll@....com>,
Rob Herring <robh+dt@...nel.org>,
Russell King <linux@....linux.org.uk>
Subject: Re: [PATCH v3 1/4] gpio: brcmstb: fix null ptr dereference in driver remove
On Thu, Jun 18, 2015 at 3:00 AM, Gregory Fong <gregory.0xf0@...il.com> wrote:
> If a failure occurs during probe, brcmstb_gpio_remove() is called. In
> remove, we call platform_get_drvdata(), but at the time of failure in
> the probe the driver data hadn't yet been set which leads to a NULL
> ptr dereference in the remove's list_for_each. Call
> platform_set_drvdata() and set up list head right after allocating the
> priv struct to both avoid the null pointer dereference that could
> occur today. To guard against potential future changes, check for
> null pointer in remove.
>
> Reported-by: Tim Ross <tross@...adcom.com>
> Signed-off-by: Gregory Fong <gregory.0xf0@...il.com>
> ---
> New in v3.
Patch applied.
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