]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ice: Fix possible NULL pointer de-reference
authorBruce Allan <bruce.w.allan@intel.com>
Wed, 7 Nov 2018 18:19:35 +0000 (10:19 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Dec 2019 07:51:31 +0000 (08:51 +0100)
[ 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 <bruce.w.allan@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_switch.c

index 4012adbab0112c419c08c44415d88dea4219f77a..1bfc59dff51f7eaf61a5226f06b253079595ca8b 100644 (file)
@@ -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;