Skip to content

Commit

Permalink
netlink: don't forget to release a rhashtable_iter structure
Browse files Browse the repository at this point in the history
This bug was detected by kmemleak:
unreferenced object 0xffff8804269cc3c0 (size 64):
  comm "criu", pid 1042, jiffies 4294907360 (age 13.713s)
  hex dump (first 32 bytes):
    a0 32 cc 2c 04 88 ff ff 00 00 00 00 00 00 00 00  .2.,............
    00 01 00 00 00 00 ad de 00 02 00 00 00 00 ad de  ................
  backtrace:
    [<ffffffff8184dffa>] kmemleak_alloc+0x4a/0xa0
    [<ffffffff8124720f>] kmem_cache_alloc_trace+0x10f/0x280
    [<ffffffffa02864cc>] __netlink_diag_dump+0x26c/0x290 [netlink_diag]

v2: don't remove a reference on a rhashtable_iter structure to
    release it from netlink_diag_dump_done

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Fixes: ad20207 ("netlink: Use rhashtable walk interface in diag dump")
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrey Vagin authored and David S. Miller committed Sep 8, 2016
1 parent 457b413 commit 733ade2
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion net/netlink/diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ static int __netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
goto done;

rhashtable_walk_exit(hti);
cb->args[2] = 0;
num++;

mc_list:
Expand Down

0 comments on commit 733ade2

Please sign in to comment.