]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
idpf: fix aux device unplugging when rdma is not supported by vport
authorLarysa Zaremba <larysa.zaremba@intel.com>
Mon, 17 Nov 2025 07:03:49 +0000 (08:03 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 6 Jan 2026 23:42:10 +0000 (15:42 -0800)
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>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/idpf/idpf_idc.c

index 7e20a07e98e5389acdd33e3a1b55fd7c2f8a2f28..6dad0593f7f22244c7bff1bb969f1ee891a3f214 100644 (file)
@@ -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);