Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: hkallweit1@gmail.com
Cc: nic_swsd@realtek.com, netdev@vger.kernel.org
Subject: Re: [PATCH v2 net] r8169: fix setting driver_data after register_netdev
Date: Tue, 27 Mar 2018 10:56:42 -0400 (EDT)	[thread overview]
Message-ID: <20180327.105642.798955649175788501.davem@davemloft.net> (raw)
In-Reply-To: <2e728314-2f34-1e51-7a4a-ae227eb2a2c6@gmail.com>

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Mon, 26 Mar 2018 19:19:30 +0200

> pci_set_drvdata() is called only after registering the net_device,
> therefore we could run into a NPE if one of the functions using
> driver_data is called before it's set.
> 
> Fix this by calling pci_set_drvdata() before registering the
> net_device.
> 
> This fix is a candidate for stable. As far as I can see the
> bug has been there in kernel version 3.2 already, therefore
> I can't provide a reference which commit is fixed by it.
> 
> The fix may need small adjustments per kernel version because
> due to other changes the label which is jumped to if
> register_netdev() fails has changed over time.
> 
> Reported-by: David Miller <davem@davemloft.net>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> v2:
> - rebased based on net instead of net-next

Applied and queued up for -stable, thanks.

      reply	other threads:[~2018-03-27 14:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 17:19 [PATCH v2 net] r8169: fix setting driver_data after register_netdev Heiner Kallweit
2018-03-27 14:56 ` David Miller [this message]

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=20180327.105642.798955649175788501.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.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