Skip to content

Commit

Permalink
net: em_canid: remove useless statements from em_canid_change
Browse files Browse the repository at this point in the history
tcf_ematch is allocated by kzalloc in function tcf_em_tree_validate(),
so cm_old is always NULL.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Duan Jiong authored and David S. Miller committed Jun 21, 2014
1 parent a3f5ee7 commit 2b74e2c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions net/sched/em_canid.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ static int em_canid_change(struct tcf_proto *tp, void *data, int len,
{
struct can_filter *conf = data; /* Array with rules */
struct canid_match *cm;
struct canid_match *cm_old = (struct canid_match *)m->data;
int i;

if (!len)
Expand Down Expand Up @@ -181,12 +180,6 @@ static int em_canid_change(struct tcf_proto *tp, void *data, int len,

m->datalen = sizeof(struct canid_match) + len;
m->data = (unsigned long)cm;

if (cm_old != NULL) {
pr_err("canid: Configuring an existing ematch!\n");
kfree(cm_old);
}

return 0;
}

Expand Down

0 comments on commit 2b74e2c

Please sign in to comment.