From 39b3a0a7f90b8d2f4d2317562c101e57d8fa6e63 Mon Sep 17 00:00:00 2001 From: Rom Lemarchand Date: Sat, 24 Jan 2015 15:08:42 -0800 Subject: staging: android: ashmem: add missing include Include into ashmem.h to ensure referenced types are defined Signed-off-by: Rom Lemarchand Change-Id: Iac18ed86dd47296d02a269607b1514724aaa9958 (cherry picked from commit 0d7c7ba9f6428e694130a40e270516618f27ce14) --- drivers/staging/android/uapi/ashmem.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/android/uapi/ashmem.h b/drivers/staging/android/uapi/ashmem.h index ba4743c71d6..13df42d200b 100644 --- a/drivers/staging/android/uapi/ashmem.h +++ b/drivers/staging/android/uapi/ashmem.h @@ -13,6 +13,7 @@ #define _UAPI_LINUX_ASHMEM_H #include +#include #define ASHMEM_NAME_LEN 256 -- cgit v1.2.3 From 32a71bce154cb89a549b9b7d28e8cf03b889d849 Mon Sep 17 00:00:00 2001 From: Amit Pundir Date: Fri, 16 Jan 2015 05:41:10 +0530 Subject: usb: gadget: check for accessory device before disconnecting HIDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While disabling ConfigFS Android gadget, android_disconnect() calls kill_all_hid_devices(), if CONFIG_USB_CONFIGFS_F_ACC is enabled, to free the registered HIDs without checking whether the USB accessory device really exist or not. If USB accessory device doesn't exist then we run into following kernel panic: ----8<---- [  136.724761] Unable to handle kernel NULL pointer dereference at virtual address 00000064 [  136.724809] pgd = c0204000 [  136.731924] [00000064] *pgd=00000000 [  136.737830] Internal error: Oops: 5 [#1] SMP ARM [  136.738108] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.18.0-rc4-00400-gf75300e-dirty #76 [  136.742788] task: c0fb19d8 ti: c0fa4000 task.ti: c0fa4000 [  136.750890] PC is at _raw_spin_lock_irqsave+0x24/0x60 [  136.756246] LR is at kill_all_hid_devices+0x24/0x114 ---->8---- This patch adds a test to check if USB Accessory device exists before freeing HIDs. Change-Id: Ie229feaf0de3f4f7a151fcaa9a994e34e15ff73b Signed-off-by: Amit Pundir --- drivers/usb/gadget/f_accessory.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/gadget/f_accessory.c b/drivers/usb/gadget/f_accessory.c index a401acdceb4..0237f1e059b 100644 --- a/drivers/usb/gadget/f_accessory.c +++ b/drivers/usb/gadget/f_accessory.c @@ -951,6 +951,10 @@ kill_all_hid_devices(struct acc_dev *dev) struct list_head *entry, *temp; unsigned long flags; + /* do nothing if usb accessory device doesn't exist */ + if (!dev) + return; + spin_lock_irqsave(&dev->lock, flags); list_for_each_safe(entry, temp, &dev->hid_list) { hid = list_entry(entry, struct acc_hid_dev, list); -- cgit v1.2.3 From c9cd4d2b110fa7285e5302aa0246bbc8a812ce4a Mon Sep 17 00:00:00 2001 From: Subramaniam Chanderashekarapuram Date: Mon, 19 Jan 2015 22:18:44 -0600 Subject: input: evdev: Remove un-necessary free in evdev_release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following commit: commit 6e71fda4b35e9b8b4f2f009b9d2b70214ea2db3a Author: Arve Hjønnevåg Date: Fri Oct 17 15:20:55 2008 -0700 Input: evdev - Add ioctl to block suspend while event queue is not empty. Add an ioctl, EVIOCSSUSPENDBLOCK, to enable a wakelock that will block suspend while the event queue is not empty. This allows userspace code to process input events while the device appears to be asleep. The current code holds the wakelock for up 5 seconds for every input device and client. This can prevent suspend if sensor with a high data rate is active, even when that sensor is not capable of waking the device once it is suspended. Change-Id: I624d66ef30a0b3abb543685c343382b8419b42b9 Signed-off-by: Arve Hjønnevåg tries to free the client handle in evdev_release. This free is not needed and the client handle cleanup is already take care of. Having this free call sometimes causes a kernel panic with the following signature: [ 83.362893] ------------[ cut here ]------------ [ 83.367737] kernel BUG at mm/slab.c:2919! [ 83.371940] Internal error: Oops - BUG: 0 [#1] SMP ARM [ 83.377325] Modules linked in: [ 83.380541] CPU: 0 PID: 1285 Comm: evtest Not tainted 3.14.26-03006-gde614db #6 [ 83.388208] task: ec39db40 ti: eb5aa000 task.ti: eb5aa000 [ 83.393876] PC is at cache_alloc_refill+0x298/0x58c [ 83.398992] LR is at cache_alloc_refill+0x78/0x58c [ 83.404024] pc : [] lr : [] psr: a0000093 [ 83.404024] sp : eb5abcd0 ip : 00100100 fp : eb5abd14 [ 83.416075] r10: ec8014c0 r9 : ec8014c4 r8 : c08b2820 [ 83.421554] r7 : ec800380 r6 : ec827d80 r5 : 0000000b r4 : ed534074 [ 83.428411] r3 : ffffffed r2 : 00000002 r1 : 00000001 r0 : ec2cf000 [ 83.435263] Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user [ 83.442839] Control: 30c5387d Table: ac22b500 DAC: fffffffd [ 83.448863] [ 83.448863] PC: 0xc00e7ce8: Change-Id: I7a1e8d9829d2a9f26cd5bb2c498ea4d265152178 Signed-off-by: Subramaniam Chanderashekarapuram --- drivers/input/evdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index fbf93cb2a4c..9188f0495f1 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -387,7 +387,6 @@ static int evdev_release(struct inode *inode, struct file *file) vfree(client); else kfree(client); - kfree(client); evdev_close_device(evdev); -- cgit v1.2.3