diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-04-09 08:16:04 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-04-09 09:58:44 +0200 |
commit | 3480a2125923e4b7a56d79efc76743089bf273fc (patch) | |
tree | 6d2e241d497ef497aa637f8ee4a4b218c4161512 /net/can | |
parent | netrom: fix invalid use of sizeof in nr_recvmsg() (diff) | |
download | linux-3480a2125923e4b7a56d79efc76743089bf273fc.tar.xz linux-3480a2125923e4b7a56d79efc76743089bf273fc.zip |
can: gw: use kmem_cache_free() instead of kfree()
Memory allocated by kmem_cache_alloc() should be freed using
kmem_cache_free(), not kfree().
Cc: linux-stable <stable@vger.kernel.org> # >= v3.2
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>
Diffstat (limited to 'net/can')
-rw-r--r-- | net/can/gw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/can/gw.c b/net/can/gw.c index 2d117dc5ebea..117814a7e73c 100644 --- a/net/can/gw.c +++ b/net/can/gw.c @@ -466,7 +466,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); } } } @@ -864,7 +864,7 @@ static void cgw_remove_all_jobs(void) hlist_for_each_entry_safe(gwj, nx, &cgw_list, list) { hlist_del(&gwj->list); cgw_unregister_filter(gwj); - kfree(gwj); + kmem_cache_free(cgw_cache, gwj); } } @@ -920,7 +920,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; } |