From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net
Cc: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
anthony.l.nguyen@intel.com,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
Aaron Brown <aaron.f.brown@intel.com>
Subject: [net v2 1/4] iavf: Fix incorrect adapter get in iavf_resume
Date: Fri, 25 Sep 2020 14:09:27 -0700 [thread overview]
Message-ID: <20200925210930.4049734-2-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20200925210930.4049734-1-anthony.l.nguyen@intel.com>
From: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
When calling iavf_resume there was a crash because wrong
function was used to get iavf_adapter and net_device pointers.
Changed how iavf_resume is getting iavf_adapter and net_device
pointers from pci_dev.
Fixes: 5eae00c57f5e ("i40evf: main driver core")
Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index d870343cf689..cf539db79af9 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -3806,8 +3806,8 @@ static int __maybe_unused iavf_suspend(struct device *dev_d)
static int __maybe_unused iavf_resume(struct device *dev_d)
{
struct pci_dev *pdev = to_pci_dev(dev_d);
- struct iavf_adapter *adapter = pci_get_drvdata(pdev);
- struct net_device *netdev = adapter->netdev;
+ struct net_device *netdev = pci_get_drvdata(pdev);
+ struct iavf_adapter *adapter = netdev_priv(netdev);
u32 err;
pci_set_master(pdev);
--
2.26.2
next prev parent reply other threads:[~2020-09-25 21:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 21:09 [net v2 0/4][pull request] Intel Wired LAN Driver Updates 2020-09-25 Tony Nguyen
2020-09-25 21:09 ` Tony Nguyen [this message]
2020-09-25 21:09 ` [net v2 2/4] ice: Fix call trace on suspend Tony Nguyen
2020-09-25 21:09 ` [net v2 3/4] ice: fix memory leak if register_netdev_fails Tony Nguyen
2020-09-25 21:09 ` [net v2 4/4] ice: fix memory leak in ice_vsi_setup Tony Nguyen
2020-09-25 23:24 ` [net v2 0/4][pull request] Intel Wired LAN Driver Updates 2020-09-25 David Miller
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=20200925210930.4049734-2-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=aaron.f.brown@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
--cc=sylwesterx.dziedziuch@intel.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).