summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-04-09 14:16:04 +0800
committerBen Hutchings <ben@decadent.org.uk>2013-04-25 20:25:35 +0100
commitd9d7d36d3ec48a8b95f6c45316e6dd62e5a7e8c1 (patch)
tree8b15ed55f4b65ed4907f77aecfe9c3483d634646
parent903bd59a75ce9755e695a8708e51714c3bf43425 (diff)
downloadlinux-stable-d9d7d36d3ec48a8b95f6c45316e6dd62e5a7e8c1.tar.gz
linux-stable-d9d7d36d3ec48a8b95f6c45316e6dd62e5a7e8c1.tar.bz2
linux-stable-d9d7d36d3ec48a8b95f6c45316e6dd62e5a7e8c1.zip
can: gw: use kmem_cache_free() instead of kfree()
commit 3480a2125923e4b7a56d79efc76743089bf273fc upstream. Memory allocated by kmem_cache_alloc() should be freed using kmem_cache_free(), not kfree(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--net/can/gw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/can/gw.c b/net/can/gw.c
index 3d79b127881e..f78f8985e082 100644
--- a/net/can/gw.c
+++ b/net/can/gw.c
@@ -436,7 +436,7 @@ static int cgw_notifier(struct notifier_block *nb,
if (gwj->src.dev == dev || gwj->dst.dev == dev) {
hlist_del(&gwj->list);
cgw_unregister_filter(gwj);
- kfree(gwj);
+ kmem_cache_free(cgw_cache, gwj);
}
}
}
@@ -850,7 +850,7 @@ static void cgw_remove_all_jobs(void)
hlist_for_each_entry_safe(gwj, n, nx, &cgw_list, list) {
hlist_del(&gwj->list);
cgw_unregister_filter(gwj);
- kfree(gwj);
+ kmem_cache_free(cgw_cache, gwj);
}
}
@@ -903,7 +903,7 @@ static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
hlist_del(&gwj->list);
cgw_unregister_filter(gwj);
- kfree(gwj);
+ kmem_cache_free(cgw_cache, gwj);
err = 0;
break;
}