From: Paul Greenwalt <paul.greenwalt@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, Paul Greenwalt <paul.greenwalt@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Subject: [PATCH iwl-next 1/3] idpf: clear drvdata on probe error path
Date: Fri, 14 Aug 2026 13:49:17 -0400 [thread overview]
Message-ID: <20260814174919.4177289-2-paul.greenwalt@intel.com> (raw)
In-Reply-To: <20260814174919.4177289-1-paul.greenwalt@intel.com>
If idpf_probe() fails after idpf_cfg_device() succeeds,
pci_set_drvdata() leaves a pointer to freed memory. Clear
it before freeing the adapter to prevent potential
use-after-free if anything accesses pci_get_drvdata().
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
---
drivers/net/ethernet/intel/idpf/idpf_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/idpf/idpf_main.c b/drivers/net/ethernet/intel/idpf/idpf_main.c
index 807608899084..6f9579c39342 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_main.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_main.c
@@ -364,6 +364,7 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
err_init_wq:
idpf_decfg_device(adapter);
err_free:
+ pci_set_drvdata(pdev, NULL);
kfree(adapter);
return err;
}
--
2.52.0
next prev parent reply other threads:[~2026-08-15 1:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 17:49 [PATCH iwl-next 0/3] idpf: add devlink info support with selftest Paul Greenwalt
2026-08-14 17:49 ` Paul Greenwalt [this message]
2026-08-14 17:49 ` [PATCH iwl-next 2/3] idpf: add devlink info support Paul Greenwalt
2026-08-14 17:49 ` [PATCH iwl-next 3/3] selftests: net: hw: add devlink info test Paul Greenwalt
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=20260814174919.4177289-2-paul.greenwalt@intel.com \
--to=paul.greenwalt@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@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