]> git.baikalelectronics.ru Git - kernel.git/commit
HID: hidraw: correctly deallocate memory on device disconnect
authorManoj Chourasia <mchourasia@nvidia.com>
Mon, 22 Jul 2013 10:03:13 +0000 (15:33 +0530)
committerJiri Kosina <jkosina@suse.cz>
Fri, 9 Aug 2013 09:27:00 +0000 (11:27 +0200)
commit590d758820211e617280230ff11b18095dd77733
treed79f836e7c2f2ec64a36af5725bccd1ef74423ee
parent5bda67c9607ec7082ed99239e7940844de55163d
HID: hidraw: correctly deallocate memory on device disconnect

This changes puts the commit 79e04768ac1 back in place
with the fixes for slab corruption because of the commit.

When a device is unplugged, wait for all processes that
have opened the device to close before deallocating the device.

This commit was solving kernel crash because of the corruption in
rb tree of vmalloc. The rootcause was the device data pointer was
geting excessed after the memory associated with hidraw was freed.

The commit 79e04768ac1 was buggy as it was also freeing the hidraw
first and then calling delete operation on the list associated with
that hidraw leading to slab corruption.

Signed-off-by: Manoj Chourasia <mchourasia@nvidia.com>
Tested-by: Peter Wu <lekensteyn@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hidraw.c