Skip to content

Commit

Permalink
act_police: remove unnecessary null pointer check
Browse files Browse the repository at this point in the history
It already has a NULL pointer check of rtab in qdisc_put_rtab().
Remove the check outside of qdisc_put_rtab().

Signed-off-by: Yang Yingliang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Yang Yingliang authored and davem330 committed Dec 19, 2013
1 parent d2adcaa commit 3b69a4c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/sched/act_police.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,8 @@ static int tcf_act_police_locate(struct net *net, struct nlattr *nla,
failure_unlock:
spin_unlock_bh(&police->tcf_lock);
failure:
if (P_tab)
qdisc_put_rtab(P_tab);
if (R_tab)
qdisc_put_rtab(R_tab);
qdisc_put_rtab(P_tab);
qdisc_put_rtab(R_tab);
if (ret == ACT_P_CREATED)
kfree(police);
return err;
Expand Down

0 comments on commit 3b69a4c

Please sign in to comment.