lkml.org 
[lkml]   [2014]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] usbnet: smsc95xx: dereferencing NULL pointer
From
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Date: Fri, 7 Nov 2014 18:52:40 +0530

> we were dereferencing dev to initialize pdata. but just after that we
> have a BUG_ON(!dev). so we were basically dereferencing the pointer
> first and then tesing it for NULL.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>

You didn't even compile test this.

Do not even bother fixing theoretical issues if you're going to be
introducing a _REAL_ serious regression into the code with your "fix":

drivers/net/usb/smsc95xx.c: In function ‘smsc95xx_resume’:
drivers/net/usb/smsc95xx.c:1674:5: warning: ‘pdata’ is used uninitialized in this function [-Wuninitialized]
u8 suspend_flags = pdata->suspend_flags;
^

So, instead of a theoretical issue, we now have a real guaranteed
crash.

You did not compile test this change, and you definitely did not
functionally test this change either.

Please do not do this ever again, thanks.
\
 
 \ /
  Last update: 2014-11-10 21:01    [W:0.086 / U:2.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site