Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7f2c42b authored by Anirudh Venkataramanan's avatar Anirudh Venkataramanan Committed by Jeff Kirsher
Browse files

ice: Fix a few null pointer dereference issues



1) When ice_ena_msix_range() fails to reserve vectors, a devm_kfree()
   warning was seen in the error flow path. So check pf->irq_tracker
   before use in ice_clear_interrupt_scheme().

2) In ice_vsi_cfg(), check vsi->netdev before use.

3) In ice_get_link_status, check link_up before use.

Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 3bcd7fa3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1483,7 +1483,7 @@ enum ice_status ice_get_link_status(struct ice_port_info *pi, bool *link_up)
	struct ice_phy_info *phy_info;
	enum ice_status status = 0;

	if (!pi)
	if (!pi || !link_up)
		return ICE_ERR_PARAM;

	phy_info = &pi->phy;
+10 −7
Original line number Diff line number Diff line
@@ -3257,9 +3257,11 @@ static void ice_clear_interrupt_scheme(struct ice_pf *pf)
	if (test_bit(ICE_FLAG_MSIX_ENA, pf->flags))
		ice_dis_msix(pf);

	if (pf->irq_tracker) {
		devm_kfree(&pf->pdev->dev, pf->irq_tracker);
		pf->irq_tracker = NULL;
	}
}

/**
 * ice_probe - Device initialization routine
@@ -4112,11 +4114,12 @@ static int ice_vsi_cfg(struct ice_vsi *vsi)
{
	int err;

	if (vsi->netdev) {
		ice_set_rx_mode(vsi->netdev);

		err = ice_restore_vlan(vsi);
		if (err)
			return err;
	}

	err = ice_vsi_cfg_txqs(vsi);
	if (!err)