ice: use flex_array_size where possible
Use the flex_array_size() helper with the recently added flexible array members in structures. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
@@ -1653,7 +1653,7 @@ ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries,
|
||||
if (!buf)
|
||||
return ICE_ERR_PARAM;
|
||||
|
||||
if (buf_size < (num_entries * sizeof(buf->elem[0])))
|
||||
if (buf_size < flex_array_size(buf, elem, num_entries))
|
||||
return ICE_ERR_PARAM;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, opc);
|
||||
|
||||
Reference in New Issue
Block a user