From: Bruce Allan Date: Wed, 7 Nov 2018 18:19:35 +0000 (-0800) Subject: ice: Fix possible NULL pointer de-reference X-Git-Tag: v4.19.89~180 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=388682b7bdde5d87fd4c316762677c0c103e728c;p=thirdparty%2Fkernel%2Fstable.git ice: Fix possible NULL pointer de-reference [ Upstream commit f25dad19ba70f7cc135da78ec013325042cd8c52 ] A recent update to smatch is causing it to report the error "we previously assumed 'm_entry->vsi_list_info' could be null". Fix that. Signed-off-by: Bruce Allan Signed-off-by: Anirudh Venkataramanan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index 4012adbab0112..1bfc59dff51f7 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -1023,6 +1023,9 @@ ice_handle_vsi_list_mgmt(struct ice_hw *hw, u16 vsi_id = new_fltr->fwd_id.vsi_id; enum ice_adminq_opc opcode; + if (!m_entry->vsi_list_info) + return ICE_ERR_CFG; + /* A rule already exists with the new VSI being added */ if (test_bit(vsi_id, m_entry->vsi_list_info->vsi_map)) return 0;