net/mlx5: DR, Add check for flex parser ID value
Allow only legal values for flex parser ID - values from 0 to 7. For other values skip the parser, and as a result the matcher creation will fail for using invalid flex parser ID. Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com> Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
This commit is contained in:
parent
08fac109f7
commit
89cdba3224
@ -1704,7 +1704,7 @@ static void dr_ste_v0_set_flex_parser(u32 *misc4_field_id,
|
||||
u32 id = *misc4_field_id;
|
||||
u8 *parser_ptr;
|
||||
|
||||
if (parser_is_used[id])
|
||||
if (id >= DR_NUM_OF_FLEX_PARSERS || parser_is_used[id])
|
||||
return;
|
||||
|
||||
parser_is_used[id] = true;
|
||||
|
@ -1833,7 +1833,7 @@ static void dr_ste_v1_set_flex_parser(u32 *misc4_field_id,
|
||||
u32 id = *misc4_field_id;
|
||||
u8 *parser_ptr;
|
||||
|
||||
if (parser_is_used[id])
|
||||
if (id >= DR_NUM_OF_FLEX_PARSERS || parser_is_used[id])
|
||||
return;
|
||||
|
||||
parser_is_used[id] = true;
|
||||
|
Loading…
Reference in New Issue
Block a user