In the ice_init_hw_tbls API, if the ice_calloc for es->written
fails, catch that error and bail out gracefully, instead of
continuing with a NULL pointer.
Signed-off-by: Surabhi Boob <surabhi.boob@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
es->ref_count = (u16 *)
ice_calloc(hw, es->count, sizeof(*es->ref_count));
+ if (!es->ref_count)
+ goto err;
+
es->written = (u8 *)
ice_calloc(hw, es->count, sizeof(*es->written));
+
+ if (!es->written)
+ goto err;
+
es->mask_ena = (u32 *)
ice_calloc(hw, es->count, sizeof(*es->mask_ena));
- if (!es->ref_count)
+
+ if (!es->mask_ena)
goto err;
}
return ICE_SUCCESS;