[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130408.113442.1325175593182860872.davem@davemloft.net>
Date: Mon, 08 Apr 2013 11:34:42 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: dingtianhong@...wei.com, edumazet@...gle.com,
alexander.h.duyck@...el.com, netdev@...r.kernel.org,
lizefan@...wei.com, huxinwei@...wei.com
Subject: Re: [PATCH] net: add checks if dev->netdev_ops is NULL in
register_netdevice()
From: Eric Dumazet <eric.dumazet@...il.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists