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)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 20 Nov 2018 19:39:04 +0000 (11:39 -0800)
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>
drivers/net/ethernet/intel/ice/ice_switch.c

index 091047f7ac027328915c565dbe21524ea47665de..2e5693107fa40aef22fb241d44589419345e9657 100644 (file)
@@ -1247,6 +1247,9 @@ ice_add_update_vsi_list(struct ice_hw *hw,
                u16 vsi_handle = new_fltr->vsi_handle;
                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_handle, m_entry->vsi_list_info->vsi_map))
                        return 0;