lkml.org 
[lkml]   [2014]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1 of 1]: musb: fixed a potential NULL pointer dereference.
On Wed, Feb 12, 2014 at 11:08:22AM +0100, Dr. H. Nikolaus Schaller wrote:
> fixed a potential NULL pointer dereference.
>
> Rationale:
> this is the only location in the musb driver where the
> otg->gadget pointer is dereferenced. Assuming that it
> is never NULL is not only potentially unsafe but was
> observed in the wild on a GTA04 (OMAP3/TPS65950 based
> board) when trying to boot a device tree based 3.14-rc2
> kernel with USB cable plugged in.
>
> DT boot appears to modify the order in which components
> (gadget driver) are loaded and linked and therefore
> an early musb interrupt triggers with a NULL gadget
> pointer ending in a kernel panic.
>
> Since a non-existing gadget can never be "active" we
> simply use a 0 value for musb->is_active.
>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>

Please don't attach patches, our tools don't like them at all.

And shouldn't we fix the root problem here, not just gloss over the fact
that this pointer is NULL at this point in time? Fixing the real issue
should be the correct solution, right?

thanks,

greg k-h


\
 
 \ /
  Last update: 2014-02-12 16:01    [W:0.048 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site