From: David Miller <davem@davemloft.net>
To: sudipm.mukherjee@gmail.com
Cc: steve.glendinning@shawell.net, netdev@vger.kernel.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usbnet: smsc95xx: dereferencing NULL pointer
Date: Mon, 10 Nov 2014 14:22:23 -0500 (EST) [thread overview]
Message-ID: <20141110.142223.816257623301941276.davem@davemloft.net> (raw)
In-Reply-To: <1415366560-27614-1-git-send-email-sudipm.mukherjee@gmail.com>
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.
next prev parent reply other threads:[~2014-11-10 19:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-07 13:22 [PATCH] usbnet: smsc95xx: dereferencing NULL pointer Sudip Mukherjee
2014-11-10 19:22 ` David Miller [this message]
2014-11-11 6:30 ` Sudip Mukherjee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141110.142223.816257623301941276.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=steve.glendinning@shawell.net \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).