Skip to content

Commit

Permalink
octeontx2-pf: Fix uninitialized boolean variable pps
Browse files Browse the repository at this point in the history
In the case where act->id is FLOW_ACTION_POLICE and also
act->police.rate_bytes_ps > 0 or act->police.rate_pkt_ps is not > 0
the boolean variable pps contains an uninitialized value when
function otx2_tc_act_set_police is called. Fix this by initializing
pps to false.

Addresses-Coverity: ("Uninitialized scalar variable)"
Fixes: 68fbff6 ("octeontx2-pf: Add police action for TC flower")
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Colin Ian King authored and davem330 committed Jul 12, 2021
1 parent 5796015 commit 71ce9d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static int otx2_tc_parse_actions(struct otx2_nic *nic,
struct otx2_nic *priv;
u32 burst, mark = 0;
u8 nr_police = 0;
bool pps;
bool pps = false;
u64 rate;
int i;

Expand Down

0 comments on commit 71ce9d9

Please sign in to comment.