Re: [BUG] vt6655: A possible sleep-in-atomic bug in vt6655_suspend

2017-10-08 Thread Greg KH
On Mon, Oct 09, 2017 at 09:10:28AM +0800, Jia-Ju Bai wrote: > According to device_main.c, the driver may sleep under a spinlock, > and the function call path is: > vt6655_suspend (acquire the spinlock) > pci_set_power_state > __pci_start_power_transition (drivers/pci/pci.c) > msleep -->

[BUG] vt6655: A possible sleep-in-atomic bug in vt6655_suspend

2017-10-08 Thread Jia-Ju Bai
According to device_main.c, the driver may sleep under a spinlock, and the function call path is: vt6655_suspend (acquire the spinlock) pci_set_power_state __pci_start_power_transition (drivers/pci/pci.c) msleep --> may sleep A possible fix is to replace msleep with mdelay in __pci_s

[PATCH v3 06/10] staging: rtl8723bs: Add space after ','

2017-10-08 Thread Harsha Sharma
Space is required after ',' according to linux-kernel coding style. Signed-off-by: Harsha Sharma --- Other patches from this patchset have already been merged and only this one is remaining. Changes in v3: -Change log message and rebase against staging-testing Changes in v2: -Rebase against sta

Re: [PATCH v2 06/10] staging: rtl8723bs: Add space after ','

2017-10-08 Thread Harsha Sharma
On Wed, Sep 13, 2017 at 2:11 AM, Greg KH wrote: > On Tue, Sep 12, 2017 at 07:05:23PM +0530, Harsha Sharma wrote: >> Space required after ',' >> >> Signed-off-by: Harsha Sharma >> --- >> Changes in v2: >> -Rebase against staging-testing and solve merge conflicts >> >> drivers/staging/rtl8723bs/o

[BUG] rtl8188eu: Some possible sleep-in-atomic bugs in ips_leave

2017-10-08 Thread Jia-Ju Bai
CC to mailing list. On 2017/10/8 20:13, Jia-Ju Bai wrote: The driver may sleep under a spinlock when calling the function "ips_leave", which causes some possible sleep-in-atomic bugs. Here are several examples: rtw_set_802_11_disassociate (acquire the spinlock) _rtw_pwr_wakeup ips_leave

[PATCH v2 3/3] rtl8188eu: Fix a possible sleep-in-atomic bug in _rtw_pwr_wakeup

2017-10-08 Thread Jia-Ju Bai
The driver may sleep under a spinlock, and the function call path is: rtw_set_802_11_disassociate(acquire the spinlock) _rtw_pwr_wakeup usleep_range --> may sleep To fix it, usleep_range is replaced with udelay. This bug is found by my static analysis tool and my code review. Signed-off-by:

[PATCH v2 2/3] rtl8188eu: Fix a possible sleep-in-atomic bug in rtw_createbss_cmd

2017-10-08 Thread Jia-Ju Bai
The driver may sleep under a spinlock, and the function call path is: rtw_surveydone_event_callback(acquire the spinlock) rtw_createbss_cmd kzalloc(GFP_KERNEL) --> may sleep To fix it, GFP_KERNEL is replaced with GFP_ATOMIC. This bug is found by my static analysis tool and my code review. S

[PATCH v2 1/3] rtl8188eu: Fix a possible sleep-in-atomic bug in rtw_disassoc_cmd

2017-10-08 Thread Jia-Ju Bai
The driver may sleep under a spinlock, and the function call path is: rtw_set_802_11_bssid(acquire the spinlock) rtw_disassoc_cmd kzalloc(GFP_KERNEL) --> may sleep To fix it, GFP_KERNEL is replaced with GFP_ATOMIC. This bug is found by my static analysis tool and my code review. Signed-off-

[PATCH 2/2] staging: atomisp: cleanup out of memory messages

2017-10-08 Thread Aishwarya Pant
Logging of explicit out of memory messages is redundant since memory allocation failures produce a backtrace. Done with the help of the following cocci script: @@ expression ex, ret; statement s; constant char[] c; constant err; identifier f, l; @@ ex = \(kmalloc\|kmalloc_array\|kzalloc\|kcalloc

[PATCH 0/2] staginng: atomisp: memory allocation cleanups

2017-10-08 Thread Aishwarya Pant
Patch series performs minor code cleanups using coccinelle to simplify memory allocation tests and remove redundant OOM log messages. Aishwarya Pant (2): staging: atomisp2: cleanup null check on memory allocation staging: atomisp: cleanup out of memory messages drivers/staging/media/atomisp/

[PATCH 1/2] staging: atomisp2: cleanup null check on memory allocation

2017-10-08 Thread Aishwarya Pant
For memory allocation functions that fail with a NULL return value, it is preferred to use the (!x) test in place of (x == NULL). Changes in atomisp2/css2400/sh_css.c were done by hand. Done with the help of the following cocci script: @@ type T; T* p; statement s,s1; @@ p = \(devm_kzalloc\|d