From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: dingtianhong@huawei.com, edumazet@google.com,
alexander.h.duyck@intel.com, netdev@vger.kernel.org,
lizefan@huawei.com, huxinwei@huawei.com
Subject: Re: [PATCH] net: add checks if dev->netdev_ops is NULL in register_netdevice()
Date: Mon, 08 Apr 2013 11:34:42 -0400 (EDT) [thread overview]
Message-ID: <20130408.113442.1325175593182860872.davem@davemloft.net> (raw)
In-Reply-To: <1365434194.3887.13.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 08 Apr 2013 08:16:34 -0700
> On Mon, 2013-04-08 at 17:43 +0800, dingtianhong wrote:
>> In some cases netdev->netdev_ops could be NULL in the register_netdevice(),
>> thus a NULL point deference happens and lead to oops:
>
>> /* Init, if this function is available */
>> - if (dev->netdev_ops->ndo_init) {
>> + if (dev->netdev_ops && dev->netdev_ops->ndo_init) {
>> ret = dev->netdev_ops->ndo_init(dev);
>> if (ret) {
>> if (ret > 0)
>> -- 1.8.0
>>
>
> Seriously ?
>
> This patch is not needed, and not complete anyway.
>
> Fix the driver instead, we don't want this to happen.
Agreed, I'm not seriously considering patches like this at all.
next prev parent reply other threads:[~2013-04-08 15:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-08 9:43 [PATCH] net: add checks if dev->netdev_ops is NULL in register_netdevice() dingtianhong
2013-04-08 15:16 ` Eric Dumazet
2013-04-08 15:34 ` David Miller [this message]
2013-04-08 15:49 ` Alexander Duyck
2013-04-10 20:45 ` Stephen Hemminger
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=20130408.113442.1325175593182860872.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=alexander.h.duyck@intel.com \
--cc=dingtianhong@huawei.com \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=huxinwei@huawei.com \
--cc=lizefan@huawei.com \
--cc=netdev@vger.kernel.org \
/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).