Commit 89cdba32 authored by Yevgeny Kliteynik's avatar Yevgeny Kliteynik Committed by Saeed Mahameed

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: default avatarHamdan Igbaria <hamdani@nvidia.com>
Signed-off-by: default avatarYevgeny Kliteynik <kliteyn@nvidia.com>
parent 08fac109
...@@ -1704,7 +1704,7 @@ static void dr_ste_v0_set_flex_parser(u32 *misc4_field_id, ...@@ -1704,7 +1704,7 @@ static void dr_ste_v0_set_flex_parser(u32 *misc4_field_id,
u32 id = *misc4_field_id; u32 id = *misc4_field_id;
u8 *parser_ptr; u8 *parser_ptr;
if (parser_is_used[id]) if (id >= DR_NUM_OF_FLEX_PARSERS || parser_is_used[id])
return; return;
parser_is_used[id] = true; parser_is_used[id] = true;
......
...@@ -1833,7 +1833,7 @@ static void dr_ste_v1_set_flex_parser(u32 *misc4_field_id, ...@@ -1833,7 +1833,7 @@ static void dr_ste_v1_set_flex_parser(u32 *misc4_field_id,
u32 id = *misc4_field_id; u32 id = *misc4_field_id;
u8 *parser_ptr; u8 *parser_ptr;
if (parser_is_used[id]) if (id >= DR_NUM_OF_FLEX_PARSERS || parser_is_used[id])
return; return;
parser_is_used[id] = true; parser_is_used[id] = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment