Skip to content

Commit

Permalink
angler: bluetooth: fix possible memory leak in kernel.
Browse files Browse the repository at this point in the history
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 <[email protected]>

Change-Id: Ie8a302af54739695e941254e1c8081a42b096111
Signed-off-by: Francisco Franco <[email protected]>
  • Loading branch information
ping wang authored and franciscofranco committed Jan 5, 2018
1 parent 6d322fa commit 1d64d75
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/bluetooth/bluesleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,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,

};

/**
Expand Down

0 comments on commit 1d64d75

Please sign in to comment.