net_sched: unify the init logic for act_police

Jamal reported a crash when we create a police action
with a specific index, this is because the init logic
is not correct, we should always create one for this
case. Just unify the logic with other tc actions.

Fixes: a03e6fe56971 ("act_police: fix a crash during removal")
Reported-by: Jamal Hadi Salim <>
Signed-off-by: Cong Wang <>
Acked-by: Jamal Hadi Salim <>
Signed-off-by: David S. Miller <>
1 file changed