lkml.org 
[lkml]   [2017]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH][serial-next] serial: 8250: don't dereference em485 until it has been null checked
From
Date
On Tue, 2017-08-29 at 23:04 +0300, Dan Carpenter wrote:
> On Tue, Aug 29, 2017 at 05:58:15PM +0100, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > Currently, the pointer em485 is dereferenced to get p and then later
> > em485 is checked to see if it is null before calling __start_tx. In
> > the case where em485 is null, we get a null pointer dereference. Fix
> > this by moving the deference and the associated spinlock/unlocks on
> > p to the code block where em485 is known to be not null.
> >
> > Detected by CoverityScan, CID#14555001 ("Dereference before null
> > check")
> >
> > Fixes 6e0a5de2136b ("serial: 8250: Use hrtimers for rs485 delays")
>
> I don't understand which tree this commit is from.  I have it fetched
> but when I do a git log on drivers/tty/serial/8250/8250_port.c then I
> don't see it.  I have today's linux-next.

I see it, though I have tty-next as well.


> I'm pretty sure "t" isn't ever NULL.

(I'm pretty sure there is a false positive, though code would be cleaned
to avoid such reports)

--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

\
 
 \ /
  Last update: 2017-08-29 22:22    [W:0.102 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site