[PATCH] staging: vc04_services: vchiq_arm: fix error return code of vchiq_release_internal() and vchiq_use_internal()

2021-03-06 Thread Jia-Ju Bai
When arm_state is NULL, no error return code of vchiq_release_internal() and vchiq_use_internal() is assigned. To fix this bug, ret is assigned with VCHIQ_ERROR. Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai --- .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8 ++-- 1 file

[PATCH] staging: media: omap4iss: fix error return code in iss_probe()

2021-03-04 Thread Jia-Ju Bai
When omap4iss_get() returns NULL, no error return code is assigned. To fix this bug, ret is assigned with -EINVAL as error return code. Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai --- drivers/staging/media/omap4iss/iss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH] staging: dgnc: Fix a sleep-in-atomic-context bug in cls_assert_modem_signals()

2018-09-14 Thread Jia-Ju Bai
cls_copy_data_from_queue_to_uart drivers/staging/dgnc/dgnc_cls.c, 406: _raw_spin_lock_irqsave in cls_copy_data_from_queue_to_uart To fix this bug, usleep_range() is replaced with udelay(). This bug is found by my static analysis tool DSAC. Signed-off-by: Jia-Ju Bai --- drivers/staging/dgnc

[PATCH] staging: rtl8188eu: Fix a sleep-in-atomic-context bug in issue_deauth_ex()

2018-09-14 Thread Jia-Ju Bai
: rtw_set_802_11_infrastructure_mode in rtw_wx_set_wap drivers/staging/rtl8188eu/os_dep/ioctl_linux.c, 988: spin_lock_bh in rtw_wx_set_wap To fix this bug, msleep() is replaced with mdelay(). This bug is found by my static analysis tool DSAC. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8188eu/core

[PATCH 2/2] staging: rtl8723bs: Fix two sleep-in-atomic-context bugs in _rtw_pwr_wakeup()

2018-09-14 Thread Jia-Ju Bai
: _rtw_pwr_wakeup in rtw_set_802_11_disassociate drivers/staging/rtl8723bs/core/rtw_ioctl_set.c, 501: spin_lock_bh in rtw_set_802_11_disassociate To fix these bugs, msleep() is replaced with mdelay(). These bugs are found by my static analysis tool DSAC. Signed-off-by: Jia-Ju Bai --- drivers

[PATCH 1/2] staging: rtl8723bs: Fix a sleep-in-atomic-context bug in issue_deauth_ex()

2018-09-14 Thread Jia-Ju Bai
bug is found by my static analysis tool DSAC. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index

[PATCH] staging: rtl8188eu: Fix two sleep-in-atomic-context bugs in rtw_chk_hi_queue_cmd()

2018-09-01 Thread Jia-Ju Bai
/usb_ops_linux.c, 604: rtw_chk_hi_queue_cmd in usb_write_port_complete To fix these bugs, GFP_KERNEL is replaced with GFP_ATOMIC. These bugs are found by my static analysis tool DSAC. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 4 ++-- 1 file changed, 2

Re: [PATCH] staging: fbtft: Replace mdelay() with msleep() and usleep_range()

2018-07-27 Thread Jia-Ju Bai
On 2018/7/27 18:34, Andy Shevchenko wrote: On Fri, Jul 27, 2018 at 12:21 PM, Jia-Ju Bai wrote: reset() and init_display() are never called in atomic context. They call mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). gpio_set_value(par

[PATCH] staging: fbtft: Replace mdelay() with msleep() and usleep_range()

2018-07-27 Thread Jia-Ju Bai
reset() and init_display() are never called in atomic context. They call mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/staging/fbtft

Re: [BUG] staging: lustre: Possible null function pointer in ctx_refresh_timeout()

2018-07-26 Thread Jia-Ju Bai
On 2018/7/26 22:12, Greg KH wrote: On Thu, Jul 26, 2018 at 10:02:22PM +0800, Jia-Ju Bai wrote: In Linux-4.16, drivers/staging/lustre/lustre/ptlrp/sec.c, Please look at the 4.18-rc6 release for this file. In short, nothing to worry about anymore :) Looks good now :) Best wishes, Jia-Ju

[BUG] staging: lustre: Possible null function pointer in ctx_refresh_timeout()

2018-07-26 Thread Jia-Ju Bai
ot;.force_die" in the kernel code. So calling the function pointer in line 573 may cause a null pointer dereference. Best wishes, Jia-Ju Bai ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: rtl8723bs: Fix two possible sleep-in-atomic-context bugs in translate_scan()

2018-06-20 Thread Jia-Ju Bai
On 2018/6/20 17:56, Dan Carpenter wrote: On Wed, Jun 20, 2018 at 05:50:16PM +0800, Jia-Ju Bai wrote: The driver may sleep with holding a spinlock. The function call paths (from bottom to top) in Linux-4.16.7 are: [FUNC] kzalloc(GFP_KERNEL) drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 323

[PATCH] staging: rtl8188eu: Fix a possible sleep-in-atomic-context bug in rtw_disassoc_cmd()

2018-06-20 Thread Jia-Ju Bai
static analysis tool (DSAC-2) and checked by my code review. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index

[PATCH] staging: rtl8723bs: Fix two possible sleep-in-atomic-context bugs in translate_scan()

2018-06-20 Thread Jia-Ju Bai
checked by my code review. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index b26533983864

[PATCH] staging: rtlwifi: Fix a possible sleep-in-atomic-context bug in _is_fw_read_cmd_down()

2018-06-19 Thread Jia-Ju Bai
. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtlwifi/halmac/rtl_halmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtlwifi/halmac/rtl_halmac.c b/drivers/staging/rtlwifi/halmac/rtl_halmac.c index 66f0a6dfc52c..e921a62e72a3 100644 --- a/drivers/staging

[PATCH] android: binder: Fix a possible data race in binder_alloc_mmap_handler

2018-05-08 Thread Jia-Ju Bai
;alloc->buffer" should be also protected by the lock. Signed-off-by: Jia-Ju Bai --- drivers/android/binder_alloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 5a426c877dfb..596acc3a84e4 100644 --- a/drive

Re: [PATCH 1/2] staging: irda: Replace mdelay with usleep_range in stir421x_fw_upload

2018-04-11 Thread Jia-Ju Bai
On 2018/4/11 22:26, David Miller wrote: From: Jia-Ju Bai Date: Wed, 11 Apr 2018 16:20:22 +0800 Okay, I now know why many of my patches were not replied. Many of your patches are not responded to because you handle patch feedback poorly sometimes. Okay, thanks for pointing it out. I will

Re: [PATCH 1/2] staging: irda: Replace mdelay with usleep_range in stir421x_fw_upload

2018-04-11 Thread Jia-Ju Bai
On 2018/4/11 16:17, Greg KH wrote: On Wed, Apr 11, 2018 at 04:11:00PM +0800, Jia-Ju Bai wrote: On 2018/4/11 16:03, Greg KH wrote: On Wed, Apr 11, 2018 at 03:17:10PM +0800, Jia-Ju Bai wrote: On 2018/4/11 14:41, Greg KH wrote: On Wed, Apr 11, 2018 at 09:29:34AM +0800, Jia-Ju Bai wrote

Re: [PATCH 1/2] staging: irda: Replace mdelay with usleep_range in stir421x_fw_upload

2018-04-11 Thread Jia-Ju Bai
On 2018/4/11 16:03, Greg KH wrote: On Wed, Apr 11, 2018 at 03:17:10PM +0800, Jia-Ju Bai wrote: On 2018/4/11 14:41, Greg KH wrote: On Wed, Apr 11, 2018 at 09:29:34AM +0800, Jia-Ju Bai wrote: stir421x_fw_upload() is never called in atomic context. The call chain ending up at

Re: [PATCH 1/2] staging: irda: Replace mdelay with usleep_range in stir421x_fw_upload

2018-04-11 Thread Jia-Ju Bai
On 2018/4/11 14:41, Greg KH wrote: On Wed, Apr 11, 2018 at 09:29:34AM +0800, Jia-Ju Bai wrote: stir421x_fw_upload() is never called in atomic context. The call chain ending up at stir421x_fw_upload() is: [1] stir421x_fw_upload() <- stir421x_patch_device() <- irda_usb_probe() irda_usb

[PATCH 2/2] staging: irda: Replace mdelay with usleep_range in irda_usb_probe

2018-04-10 Thread Jia-Ju Bai
sy waiting. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai --- drivers/staging/irda/drivers/irda-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/irda/drivers/irda-usb.c

[PATCH 1/2] staging: irda: Replace mdelay with usleep_range in stir421x_fw_upload

2018-04-10 Thread Jia-Ju Bai
gned-off-by: Jia-Ju Bai --- drivers/staging/irda/drivers/irda-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/irda/drivers/irda-usb.c b/drivers/staging/irda/drivers/irda-usb.c index 723e49b..c6c8c2c 100644 --- a/drivers/staging/irda/drivers/irda-usb.c +++ b

[PATCH 6/6] staging: rtl8192u: Replace mdelay with usleep_range in dm_TXPowerTrackingCallback_TSSI

2018-04-10 Thread Jia-Ju Bai
, dm_TXPowerTrackingCallback_TSSI() calls mdelay() to busily wait. This is not necessary and can be replaced with usleep_range() to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. And I also manually check it Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8192u

[PATCH 5/6] staging: rtl8192u: Replace mdelay with usleep_range in rtl8192_usb_disconnect

2018-04-10 Thread Jia-Ju Bai
laced with usleep_range() to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/stagin

[PATCH 3/6] staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in prism2_wep_init

2018-04-10 Thread Jia-Ju Bai
location. This is found by a static analysis tool named DCNS written by myself. And I also manually check it Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/

[PATCH 4/6] staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_softmac_init

2018-04-10 Thread Jia-Ju Bai
tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rt

[PATCH 2/6] staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_tkip_init

2018-04-10 Thread Jia-Ju Bai
f sucessful allocation. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rt

[PATCH 1/6] staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_ccmp_init

2018-04-10 Thread Jia-Ju Bai
ossibility of sucessful allocation. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[PATCH] staging: ks7010: Replace mdelay with usleep_range in ks7010_upload_firmware

2018-04-10 Thread Jia-Ju Bai
Despite never getting called from atomic context, ks7010_upload_firmware() calls mdelay() to busily wait. This is not necessary and can be replaced with usleep_range() to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-o

Re: [PATCH v4 1/2] staging: vt6655: check for memory allocation failures

2018-03-31 Thread Jia-Ju Bai
+ goto err_init_td1_ring; device_init_registers(priv); @@ -1178,6 +1226,15 @@ static int vnt_start(struct ieee80211_hw *hw) ieee80211_wake_queues(hw); return 0; + +err_init_td1_ring: + device_free_td0_ring(priv); +err_init_td0_ring: + device_free_rd1_ring(priv); +err_init_rd1_ring: + device_free_rd0_ring(priv); +err_init_rd0_ring: + return ret; } static void vnt_stop(struct ieee80211_hw *hw) It looks okay now :) Best wishes, Jia-Ju Bai ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v3] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Jia-Ju Bai
On 2018/3/30 11:39, Ji-Hun Kim wrote: On Fri, Mar 30, 2018 at 11:15:03AM +0800, Jia-Ju Bai wrote: On 2018/3/30 10:44, Ji-Hun Kim wrote: @@ -1165,10 +1205,18 @@ static int vnt_start(struct ieee80211_hw *hw) } dev_dbg(&priv->pcid->dev, "call device

Re: [PATCH v3] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Jia-Ju Bai
device_free_rd1_ring(priv); error_init_rd1_ring: device_free_rd0_ring(priv); error_init_rd0_ring: return ret; Best wishes, Jia-Ju Bai ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Jia-Ju Bai
it_rd0_ring() is called by vnt_start(). You should also implement error handling code in vnt_start(), and let vnt_start() returns an error number too. The same for device_init_rd1_ring(), device_init_td0_ring() and device_init_td1_ring(). Best wishes, Jia-Ju Bai __

Re: [PATCH] staging: vt6655: check for memory allocation failures

2018-03-28 Thread Jia-Ju Bai
ot correct, because it is dangerous to return directly. I think you should return an error and then implement error handling code for these functions. Best wishes, Jia-Ju Bai ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 1/2] pci: host: pci-hyperv: Replace GFP_ATOMIC with GFP_KERNEL in hv_pci_onchannelcallback

2018-03-19 Thread Jia-Ju Bai
On 2018/3/19 16:38, Dan Carpenter wrote: On Sun, Mar 18, 2018 at 10:53:02PM +0800, Jia-Ju Bai wrote: hv_pci_onchannelcallback() is not called in atomic context. The call chain ending up at hv_pci_onchannelcallback() is: [1] hv_pci_onchannelcallback() <- hv_pci_probe() hv_pci_probe() is o

Re: [PATCH 1/2] pci: host: pci-hyperv: Replace GFP_ATOMIC with GFP_KERNEL in hv_pci_onchannelcallback

2018-03-18 Thread Jia-Ju Bai
On 2018/3/19 10:52, KY Srinivasan wrote: -Original Message- From: Jia-Ju Bai Sent: Sunday, March 18, 2018 7:53 AM To: KY Srinivasan ; Haiyang Zhang ; Stephen Hemminger ; bhelg...@google.com Cc: de...@linuxdriverproject.org; linux-...@vger.kernel.org; linux- ker...@vger.kernel.org

[PATCH 2/2] pci: host: pci-hyperv: Replace GFP_ATOMIC with GFP_KERNEL in new_pcichild_device

2018-03-18 Thread Jia-Ju Bai
ice() calls kzalloc with GFP_ATOMIC, which waits busily for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/pci/host/pci-hyperv.c | 2 +- 1 f

[PATCH 1/2] pci: host: pci-hyperv: Replace GFP_ATOMIC with GFP_KERNEL in hv_pci_onchannelcallback

2018-03-18 Thread Jia-Ju Bai
led from atomic context, hv_pci_onchannelcallback() calls kmalloc with GFP_ATOMIC, which waits busily for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-J

[PATCH] staging: rtl8192u: Replace mdelay with msleep in rtl8192_usb_probe

2017-12-30 Thread Jia-Ju Bai
rtl8192_usb_probe is not called in an interrupt handler nor holding a spinlock. The function mdelay in it can be replaced with msleep, to avoid busy wait. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8192u/r8192U_core.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH] staging: rtl8192u: Replace mdelay with msleep in rtl8192_usb_probe

2017-12-24 Thread Jia-Ju Bai
rtl8192_usb_probe is not called in an interrupt handler nor holding a spinlock. The function mdelay in it can be replaced with msleep, to avoid busy wait. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8192u/r8192U_core.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

Re: [PATCH V2] hyper-v: use GFP_KERNEL for hv_context.hv_numa_map

2017-12-19 Thread Jia-Ju Bai
On 2017/12/19 1:05, Stephen Hemminger wrote: On Mon, 18 Dec 2017 17:02:52 +0800 Jia-Ju Bai wrote: The kzalloc function is called with GFP_ATOMIC. But according to driver call graph, it is not in atomic context, namely no spinlock is held nor in an interrupt handler. This GFP_ATOMIC is

[PATCH] staging: vt6655: Use GFP_KERNEL in kzalloc

2017-12-18 Thread Jia-Ju Bai
Four kzalloc functions are called with GFP_ATOMIC. But according to driver call graph, they are not in atomic context, namely no spinlock is held nor in an interrupt handler. All these "GFP_ATOMIC"s are unnecessary, and replace with with "GFP_KERNEL"s. Signed-off-by: Jia-

[PATCH V2] hyper-v: use GFP_KERNEL for hv_context.hv_numa_map

2017-12-18 Thread Jia-Ju Bai
The kzalloc function is called with GFP_ATOMIC. But according to driver call graph, it is not in atomic context, namely no spinlock is held nor in an interrupt handler. This GFP_ATOMIC is unnecessary, and replace with GFP_KERNEL. Signed-off-by: Jia-Ju Bai --- drivers/hv/hv.c |2 +- 1 file

Re: [PATCH] hv: Fix unnecessary sleeping in hv_synic_alloc

2017-12-18 Thread Jia-Ju Bai
On 2017/12/18 16:54, Vitaly Kuznetsov wrote: Jia-Ju Bai writes: The kzalloc function is called with GFP_ATOMIC. But according to driver call graph, it is not in atomic context, namely no spinlock is held nor in an interrupt handler. This GFP_ATOMIC is unnecessary, and replace with

[PATCH] hv: Fix unnecessary sleeping in hv_synic_alloc

2017-12-18 Thread Jia-Ju Bai
The kzalloc function is called with GFP_ATOMIC. But according to driver call graph, it is not in atomic context, namely no spinlock is held nor in an interrupt handler. This GFP_ATOMIC is unnecessary, and replace with GFP_KERNEL. Signed-off-by: Jia-Ju Bai --- drivers/hv/hv.c |2 +- 1 file

[PATCH] rtl8188eu: Fix a possible sleep-in-atomic bug in set_tx_beacon_cmd

2017-12-12 Thread Jia-Ju Bai
by my static analysis tool(DSAC) and checked by my code review. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188e

[PATCH] vme: Fix a possible sleep-in-atomic bug in vme_tsi148

2017-12-12 Thread Jia-Ju Bai
ool(DSAC) and checked by my code review. Signed-off-by: Jia-Ju Bai --- drivers/vme/vme.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c index 8124622..92500f6 100644 --- a/drivers/vme/vme.c +++ b/drivers/vme/vme.c @@ -1290,7 +129

[BUG] vme_ca91cx42: a possible sleep-in-atomic bug in ca91cx42_master_set

2017-12-12 Thread Jia-Ju Bai
is found by my static analysis tool (DSAC) and checked by my code review. Thanks, Jia-Ju Bai ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH] vt6655: Fix a possible sleep-in-atomic bug in vt6655_suspend

2017-10-09 Thread Jia-Ju Bai
und by my static analysis tool and my code review. Signed-off-by: Jia-Ju Bai --- drivers/staging/vt6655/device_main.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 9fcf2e2..1123b4f 100

Re: [PATCH] pci: Fix a possible sleep-in-atomic bug in pci_set_power_state

2017-10-09 Thread Jia-Ju Bai
Oh, sorry, I will send the patches for each driver. Thanks, Jia-Ju Bai On 2017/10/9 16:17, Greg KH wrote: On Mon, Oct 09, 2017 at 04:16:20PM +0800, Jia-Ju Bai wrote: The drivers vt6655 and gma500 call pci_set_power_state under a spinlock, which may sleep. The function call paths are

[PATCH] pci: Fix a possible sleep-in-atomic bug in pci_set_power_state

2017-10-09 Thread Jia-Ju Bai
bugs are found by my static analysis tool and my code review. Signed-off-by: Jia-Ju Bai --- drivers/pci/pci.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 6078dfc..7b763a3 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c

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

2017-10-09 Thread Jia-Ju Bai
Okay, I will send a patch :) Thanks, Jia-Ju Bai On 2017/10/9 13:43, Greg KH wrote: 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

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

2017-10-08 Thread Jia-Ju Bai
in __pci_start_power_transition in drivers/pci/pci.c. This bug is found by my static analysis tool and my code review. Thanks, Jia-Ju Bai ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driver

[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

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

2017-10-08 Thread Jia-Ju Bai
-by: Jia-Ju Bai --- drivers/staging/rtl8188eu/core/rtw_pwrctrl.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c index f86c9ce..2913661 100644 --- a/drivers/staging/rtl8188eu/c

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

2017-10-08 Thread Jia-Ju Bai
iew. Signed-off-by: Jia-Ju Bai --- drivers/staging/rtl8188eu/core/rtw_cmd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 9461bce..430b8eb 100644 --- a/drivers/staging/rtl8188eu/c

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

2017-10-08 Thread Jia-Ju Bai
off-by: Jia-Ju Bai --- drivers/staging/rtl8188eu/core/rtw_cmd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 9461bce..65083a7 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cm

[PATCH] staging/rtl8188eu: Fix a possible sleep-in-atomic bug in rtw_disassoc_cmd

2017-10-07 Thread Jia-Ju Bai
off-by: Jia-Ju Bai --- drivers/staging/rtl8188eu/core/rtw_cmd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 9461bce..65083a7 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cm

[PATCH] rts5208: Fix a sleep-in-atomic bug in sd_send_cmd_get_rsp

2017-06-13 Thread Jia-Ju Bai
sd_ddr_pre_tuning_tx sd_send_cmd_get_rsp wait_timeout schedule_timeout --> may sleep To fix it, "wait_timeout" is replaced with mdelay in sd_send_cmd_get_rsp. Signed-off-by: Jia-Ju Bai --- drivers/staging/rts5208/sd.c |2 +- 1 file changed

[PATCH V2] staging: rt5208: Fix a sleep-in-atomic bug in xd_copy_page

2017-06-05 Thread Jia-Ju Bai
schedule_timeout --> may sleep To fix it, "wait_timeout" is replaced with mdelay in xd_copy_page. Signed-off-by: Jia-Ju Bai --- V2: * Add code explanation in this patch. --- drivers/staging/rts5208/xd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

[PATCH V2] staging: rt5208: Fix a sleep-in-atomic bug in xd_copy_page

2017-06-05 Thread Jia-Ju Bai
schedule_timeout --> may sleep To fix it, "wait_timeout" is replaced with mdelay in xd_copy_page. Signed-off-by: Jia-Ju Bai --- V2: * Add code explanation in this patch. drivers/staging/rts5208/xd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

[BUG] rts5208: Sleeping under a spin lock in free_zone

2017-06-04 Thread Jia-Ju Bai
xd_set_unused_block free_zone vfree --> may sleep This bug is found by my static analysis tool and my code review. I hope to fix it, but I do not have a good solution. Thanks, Jia-Ju Bai ___ devel mailing list de...@linuxdriverproject.

[BUG] rts5208: Sleeping under a spin lock in xd_build_l2p_tbl

2017-06-04 Thread Jia-Ju Bai
xd_set_unused_block xd_build_l2p_tbl vmalloc --> may sleep This bug is found by my static analysis tool and my code review. I hope to fix it, but I do not have a good solution. Thanks, Jia-Ju Bai ___ devel mailing list

[BUG] rts5208: Sleeping under a spin lock in xd_init_l2p_tbl

2017-06-04 Thread Jia-Ju Bai
xd_set_unused_block xd_build_l2p_tbl xd_init_l2p_tbl vmalloc --> may sleep This bug is found by my static analysis tool and my code review. I hope to fix it, but I do not have a good solution. Thanks, Jia-Ju Bai ___ de

[PATCH] rts5208: Fix a sleep-in-atomic bug in sd_send_cmd_get_rsp

2017-06-04 Thread Jia-Ju Bai
sd_ddr_pre_tuning_tx sd_send_cmd_get_rsp wait_timeout schedule_timeout --> may sleep To fix it, "wait_timeout" is replaced with mdelay in sd_send_cmd_get_rsp. Signed-off-by: Jia-Ju Bai --- drivers/staging/rts5208/sd.c |2 +- 1 file changed

[PATCH resend] rt5208: Fix a sleep-in-atomic bug in xd_copy_page

2017-06-04 Thread Jia-Ju Bai
xd_finish_write xd_copy_page wait_timeout schedule_timeout --> may sleep To fix it, "wait_timeout" is replaced with mdelay in xd_copy_page. Signed-off-by: Jia-Ju Bai --- drivers/staging/rts5208/xd.c |2 +- 1 file changed, 1 insertion(+

[PATCH] rt5208: Fix a sleep-in-atomic bug in xd_copy_page

2017-06-04 Thread Jia-Ju Bai
Signed-off-by: Jia-Ju Bai --- drivers/staging/rts5208/xd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c index 85aba05..74d36f9 100644 --- a/drivers/staging/rts5208/xd.c +++ b/drivers/staging/rts5208/xd.c

Re: [PATCH] rts5208: Fix a sleep-in-atomic bug in rtsx_exclusive_enter_ss

2017-06-04 Thread Jia-Ju Bai
On 06/03/2017 04:52 PM, Greg KH wrote: On Thu, Jun 01, 2017 at 11:43:35AM +0800, Jia-Ju Bai wrote: The driver may sleep under a spin lock, and the function call path is: rtsx_exclusive_enter_ss (acquire the lock by spin_lock) rtsx_enter_ss rtsx_power_off_card sd_cleanup_work

[PATCH] rts5208: Fix a sleep-in-atomic bug in sd_power_off_card3v3

2017-05-31 Thread Jia-Ju Bai
; is replaced with mdelay in sd_power_off_card3v3. Signed-off-by: Jia-Ju Bai --- drivers/staging/rts5208/sd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index bdd35b6..aa14454 100644 --- a/drivers/staging/rts52

[PATCH] rts5208: Fix a sleep-in-atomic bug in rtsx_exclusive_enter_ss

2017-05-31 Thread Jia-Ju Bai
sd_ddr_pre_tuning_tx sd_change_phase wait_timeout schedule_timeout --> may sleep To fix it, "wait_timeout" is replaced with mdelay in sd_change_phase. Signed-off-by: Jia-Ju Bai --- drivers/staging/rts5208/sd.c |2 +- 1 file changed, 1 in

[PATCH] libcfs: Fix a sleep-in-atomic bug in cfs_percpt_lock and cfs_percpt_unlock

2017-05-31 Thread Jia-Ju Bai
the spin_lock and spin_unlock. Signed-off-by: Jia-Ju Bai --- drivers/staging/lustre/lnet/libcfs/libcfs_lock.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c b/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c i

[PATCH] libcfs: Fix a sleep-in-atomic bug in cfs_wi_scheduler

2017-05-31 Thread Jia-Ju Bai
d spin_unlock. Signed-off-by: Jia-Ju Bai --- drivers/staging/lustre/lnet/libcfs/workitem.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/workitem.c b/drivers/staging/lustre/lnet/libcfs/workitem.c index dbc2a9b..9f7832e 100644

[PATCH V2] libcfs: Fix a sleep-in-atomic bug in cfs_wi_deschedule

2017-05-31 Thread Jia-Ju Bai
d spin_unlock. Signed-off-by: Jia-Ju Bai --- drivers/staging/lustre/lnet/libcfs/workitem.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/workitem.c b/drivers/staging/lustre/lnet/libcfs/workitem.c index dbc2a9b..9c530cf 100644

[PATCH] libcfs: Fix a sleep-in-atomic bug in cfs_wi_schedule

2017-05-31 Thread Jia-Ju Bai
d spin_unlock. Signed-off-by: Jia-Ju Bai --- drivers/staging/lustre/lnet/libcfs/workitem.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/workitem.c b/drivers/staging/lustre/lnet/libcfs/workitem.c index dbc2a9b..30d28cd 100644 --- a/dr

[PATCH] libcfs: Fix a sleep-in-atomic bug in cfs_wi_sched_destroy

2017-05-31 Thread Jia-Ju Bai
d spin_unlock. Signed-off-by: Jia-Ju Bai --- drivers/staging/lustre/lnet/libcfs/workitem.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet/libcfs/workitem.c b/drivers/staging/lustre/lnet/libcfs/workitem.c index dbc2a9b..e0424f6 100644 --- a/dr

[PATCH V2] libcfs: Fix a sleep-in-atomic bug in cfs_wi_exit

2017-05-31 Thread Jia-Ju Bai
lock. Signed-off-by: Jia-Ju Bai --- drivers/staging/lustre/lnet/libcfs/workitem.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/workitem.c b/drivers/staging/lustre/lnet/libcfs/workitem.c index dbc2a9b..928d06d 100644

[PATCH] libcfs: Fix a sleep-in-atomic bug in cfs_wi_deschedule

2017-05-31 Thread Jia-Ju Bai
d spin_unlock. Signed-off-by: Jia-Ju Bai --- drivers/staging/lustre/lnet/libcfs/workitem.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/workitem.c b/drivers/staging/lustre/lnet/libcfs/workitem.c index dbc2a9b..7e25eb9 100644