This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

angler: bluetooth: fix possible memory leak in kernel.

Add single_release in bluesleep driver to possible fix memory leak issue.

unreferenced object 0xffffffc040e92780 (size 64):
  comm "bluedroid wake/", pid 4403, jiffies 4294941622 (age 66.090s)
  hex dump (first 32 bytes):
    b0 e6 31 00 c0 ff ff ff d4 e6 31 00 c0 ff ff ff  ..1.......1.....
    c0 e6 31 00 c0 ff ff ff b4 3b 8d 00 c0 ff ff ff  ..1......;......
  backtrace:
    [<ffffffc0002fdc68>] create_object+0x13c/0x284
    [<ffffffc000cad944>] kmemleak_alloc+0x7c/0xb8
    [<ffffffc0002f9e00>] kmem_cache_alloc_trace+0x124/0x1b0
    [<ffffffc00031f3a8>] single_open+0x38/0xac
    [<ffffffc0008d322c>] bluesleep_proc_open+0x24/0x30
    [<ffffffc00034d644>] proc_reg_open+0xa4/0x114
    [<ffffffc0002ff870>] do_dentry_open+0x18c/0x248
    [<ffffffc000300694>] finish_open+0x34/0x54
    [<ffffffc00030d3fc>] do_last.isra.36+0x83c/0x9fc
    [<ffffffc00030d674>] path_openat.isra.37+0xb8/0x3fc
    [<ffffffc00030d9ec>] do_filp_open+0x34/0x8c
    [<ffffffc000300a9c>] do_sys_open+0x128/0x1c0
    [<ffffffc000345724>] compat_SyS_openat+0x8/0x14
    [<ffffffc000203a68>] cpu_switch_to+0x48/0x4c
    [<ffffffffffffffff>] 0xffffffffffffffff

Bug: 23217611

Signed-off-by: ping wang <brucewong.wang@huawei.com>

Change-Id: Ie8a302af54739695e941254e1c8081a42b096111
  • Loading branch information...
ping wang Ed Tam
ping wang authored and Ed Tam committed Aug 20, 2015
1 parent 900833c commit 60f4c3f9fa9d17db2c2c793774e0e2d60730d5e6
Showing with 4 additions and 0 deletions.
  1. +4 −0 drivers/bluetooth/bluesleep.c
@@ -689,11 +689,15 @@ static const struct file_operations bluesleep_proc_readwrite_fops = {
.open = bluesleep_proc_open,
.read = seq_read,
.write = bluesleep_proc_write,
.release = single_release,
};
static const struct file_operations bluesleep_proc_read_fops = {
.owner = THIS_MODULE,
.open = bluesleep_proc_open,
.read = seq_read,
.release = single_release,
};
/**

0 comments on commit 60f4c3f

Please sign in to comment.