mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH iwl-net] idpf: fix aux device unplugging when rdma is not supported by vport
@ 2025-11-17  7:03 Larysa Zaremba
  2025-11-17  7:25 ` [Intel-wired-lan] " Paul Menzel
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Larysa Zaremba @ 2025-11-17  7:03 UTC (permalink / raw)
  To: Tony Nguyen, intel-wired-lan
  Cc: Larysa Zaremba, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel,
	Emil Tantilov, Madhu Chittim, Josh Hay

If vport flags do not contain VIRTCHNL2_VPORT_ENABLE_RDMA, driver does not
allocate vdev_info for this vport. This leads to kernel NULL pointer
dereference in idpf_idc_vport_dev_down(), which references vdev_info for
every vport regardless.

Check, if vdev_info was ever allocated before unplugging aux device.

Fixes: be91128c579c ("idpf: implement RDMA vport auxiliary dev create, init, and destroy")
Reviewed-by: Madhu Chittim <madhu.chittim@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
---
 drivers/net/ethernet/intel/idpf/idpf_idc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_idc.c b/drivers/net/ethernet/intel/idpf/idpf_idc.c
index c1b963f6bfad..4b1037eb2623 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_idc.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_idc.c
@@ -322,7 +322,7 @@ static void idpf_idc_vport_dev_down(struct idpf_adapter *adapter)
 	for (i = 0; i < adapter->num_alloc_vports; i++) {
 		struct idpf_vport *vport = adapter->vports[i];
 
-		if (!vport)
+		if (!vport || !vport->vdev_info)
 			continue;
 
 		idpf_unplug_aux_dev(vport->vdev_info->adev);
-- 
2.47.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-05 22:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-17  7:03 [PATCH iwl-net] idpf: fix aux device unplugging when rdma is not supported by vport Larysa Zaremba
2025-11-17  7:25 ` [Intel-wired-lan] " Paul Menzel
2025-11-17 12:33   ` Larysa Zaremba
2025-11-17  7:28 ` Loktionov, Aleksandr
2026-01-05 22:41 ` Singh, Krishneil K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®