Skip to content

Commit

Permalink
[NET_SCHED]: cls_u32: remove unnecessary NULL-ptr check
Browse files Browse the repository at this point in the history
In both cases n can't be NULL without crashing anyway.

Coverity #78

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Mar 23, 2006
1 parent a5cdc03 commit 1ae39a4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/sched/cls_u32.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,7 @@ static int u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n)
if (n->ht_down)
n->ht_down->refcnt--;
#ifdef CONFIG_CLS_U32_PERF
if (n)
kfree(n->pf);
kfree(n->pf);
#endif
kfree(n);
return 0;
Expand Down Expand Up @@ -680,8 +679,7 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
return 0;
}
#ifdef CONFIG_CLS_U32_PERF
if (n)
kfree(n->pf);
kfree(n->pf);
#endif
kfree(n);
return err;
Expand Down

0 comments on commit 1ae39a4

Please sign in to comment.