net: em_canid: remove useless statements from em_canid_change
authorDuan Jiong <duanj.fnst@cn.fujitsu.com>
Wed, 18 Jun 2014 08:48:39 +0000 (16:48 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 21 Jun 2014 22:40:22 +0000 (15:40 -0700)
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>
net/sched/em_canid.c

index bfd34e4c1afc50f6569ecc57eda942ff25e2caea..7c292d474f47861f3d9e293a1e7c55da7f38c5ca 100644 (file)
@@ -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)
@@ -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;
 }