Skip to content

Commit 4648fb2

Browse files
walking-machineanguy11
authored andcommitted
idpf: fix aux device unplugging when rdma is not supported by vport
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: be91128 ("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>
1 parent 086efe0 commit 4648fb2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/intel/idpf/idpf_idc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static void idpf_idc_vport_dev_down(struct idpf_adapter *adapter)
322322
for (i = 0; i < adapter->num_alloc_vports; i++) {
323323
struct idpf_vport *vport = adapter->vports[i];
324324

325-
if (!vport)
325+
if (!vport || !vport->vdev_info)
326326
continue;
327327

328328
idpf_unplug_aux_dev(vport->vdev_info->adev);

0 commit comments

Comments
 (0)