• Alexander Usyskin's avatar
    mei: don't unset read cb ptr on reset · 24a50910
    Alexander Usyskin authored
    commit 5cb906c7035f03a3a44fecece9d3ff8fcc75d6e0 upstream.
    
    Don't set read callback to NULL during reset as
    this leads to memory leak of both cb and its buffer.
    The memory is correctly freed during mei_release.
    
    The memory leak is detectable by kmemleak if
    application has open read call while system is going through
    suspend/resume.
    
    unreferenced object 0xecead780 (size 64):
      comm "AsyncTask #1", pid 1018, jiffies 4294949621 (age 152.440s)
      hex dump (first 32 bytes):
        00 01 10 00 00 02 20 00 00 bf 30 f1 00 00 00 00  ...... ...0.....
        00 00 00 00 00 00 00 00 36 01 00 00 00 70 da e2  ........6....p..
      backtrace:
        [<c1a60aec>] kmemleak_alloc+0x3c/0xa0
        [<c131ed56>] kmem_cache_alloc_trace+0xc6/0x190
        [<c16243c9>] mei_io_cb_init+0x29/0x50
        [<c1625722>] mei_cl_read_start+0x102/0x360
        [<c16268f3>] mei_read+0x103/0x4e0
        [<c1324b09>] vfs_read+0x89/0x160
        [<c1324d5f>] SyS_read+0x4f/0x80
        [<c1a7b318>] syscall_call+0x7/0xb
        [<ffffffff>] 0xffffffff
    unreferenced object 0xe2da7000 (size 512):
      comm "AsyncTask #1", pid 1018, jiffies 4294949621 (age 152.440s)
      hex dump (first 32 bytes):
        00 6c da e2 7c 00 00 00 00 00 00 00 c0 eb 0c 59  .l..|..........Y
        1b 00 00 00 01 00 00 00 02 10 00 00 01 00 00 00  ................
      backtrace:
        [<c1a60aec>] kmemleak_alloc+0x3c/0xa0
        [<c131f127>] __kmalloc+0xe7/0x1d0
        [<c162447e>] mei_io_cb_alloc_resp_buf+0x2e/0x60
        [<c162574c>] mei_cl_read_start+0x12c/0x360
        [<c16268f3>] mei_read+0x103/0x4e0
        [<c1324b09>] vfs_read+0x89/0x160
        [<c1324d5f>] SyS_read+0x4f/0x80
        [<c1a7b318>] syscall_call+0x7/0xb
        [<ffffffff>] 0xffffffff
    Signed-off-by: 's avatarAlexander Usyskin <alexander.usyskin@intel.com>
    Signed-off-by: 's avatarTomas Winkler <tomas.winkler@intel.com>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    24a50910
Name
Last commit
Last update
..
altera-stapl Loading commit data...
c2port Loading commit data...
carma Loading commit data...
cb710 Loading commit data...
eeprom Loading commit data...
ibmasm Loading commit data...
lis3lv02d Loading commit data...
mei Loading commit data...
sgi-gru Loading commit data...
sgi-xp Loading commit data...
ti-st Loading commit data...
vmw_vmci Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
ad525x_dpot-i2c.c Loading commit data...
ad525x_dpot-spi.c Loading commit data...
ad525x_dpot.c Loading commit data...
ad525x_dpot.h Loading commit data...
apds9802als.c Loading commit data...
apds990x.c Loading commit data...
arm-charlcd.c Loading commit data...
atmel-ssc.c Loading commit data...
atmel_pwm.c Loading commit data...
atmel_tclib.c Loading commit data...
bh1770glc.c Loading commit data...
bh1780gli.c Loading commit data...
bmp085-i2c.c Loading commit data...
bmp085-spi.c Loading commit data...
bmp085.c Loading commit data...
bmp085.h Loading commit data...
cs5535-mfgpt.c Loading commit data...
ds1682.c Loading commit data...
dummy-irq.c Loading commit data...
enclosure.c Loading commit data...
ep93xx_pwm.c Loading commit data...
fsa9480.c Loading commit data...
hmc6352.c Loading commit data...
hpilo.c Loading commit data...
hpilo.h Loading commit data...
ics932s401.c Loading commit data...
ioc4.c Loading commit data...
isl29003.c Loading commit data...
isl29020.c Loading commit data...
kgdbts.c Loading commit data...
lattice-ecp3-config.c Loading commit data...
lkdtm.c Loading commit data...
pch_phub.c Loading commit data...
phantom.c Loading commit data...
pti.c Loading commit data...
spear13xx_pcie_gadget.c Loading commit data...
sram.c Loading commit data...
ti_dac7512.c Loading commit data...
tifm_7xx1.c Loading commit data...
tifm_core.c Loading commit data...
tsl2550.c Loading commit data...
vmw_balloon.c Loading commit data...