[PATCH] staging: axis-fifo: add error handling of class_create()

2018-09-28 Thread Alexey Khoroshilov
Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/axis-fifo/axis-fifo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c index abeee0ecc122

[PATCH] staging: iio: ad7152: Fix deadlock in ad7152_write_raw_samp_freq()

2017-05-26 Thread Alexey Khoroshilov
-by: Alexey Khoroshilov --- drivers/staging/iio/cdc/ad7152.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/iio/cdc/ad7152.c b/drivers/staging/iio/cdc/ad7152.c index dc6ecd824365..ff10d1f0a7e4 100644 --- a/drivers/staging/iio/cdc/ad7152.c +++ b/drivers/stag

[media] s5p-cec: strange clk enabling pattern

2017-02-23 Thread Alexey Khoroshilov
data(dev); int ret; ret = clk_prepare_enable(cec->clk); if (ret < 0) return ret; return 0; } Is it ok to enable/disable clock in rusume/suspend only? Or have I missed anything? -- Thank you, Alexey Khoroshilov Linux Verification Center, ISPRAS

[PATCH v3] staging: wilc1000: fix double mutex_unlock on failure path in wilc_wlan_cleanup()

2015-12-22 Thread Alexey Khoroshilov
If hif_read_reg() or hif_write_reg() fail in wilc_wlan_cleanup(), it calls release_bus() and continues execution. But it leads to double release_bus() call that means double unlock of g_linux_wlan->hif_cs mutex. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Ale

[PATCH] staging: wilc1000: fix double mutex_unlock on failure path in wilc_wlan_cleanup()

2015-12-20 Thread Alexey Khoroshilov
If hif_read_reg() or hif_write_reg() fail in wilc_wlan_cleanup(), it calls release_bus() and continues execution. But it leads to double release_bus() call that means double unlock of g_linux_wlan->hif_cs mutex. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Ale

[PATCH] staging: wilc1000: fix double mutex_unlock on failure path in wilc_wlan_cleanup()

2015-12-04 Thread Alexey Khoroshilov
ect (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/wilc1000/wilc_wlan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index c02665747705..cd7f52a51173 100644 --- a/drivers/staging/wilc1

[PATCH] [media] lirc_imon: do not leave imon_probe() with mutex held

2015-11-14 Thread Alexey Khoroshilov
n project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Fixes: af8a819a2513 ("[media] lirc_imon: simplify error handling code") --- drivers/staging/media/lirc/lirc_imon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers

[BUG] IB/hfi1: might sleep under spinlock in hfi1_ioctl()

2015-10-30 Thread Alexey Khoroshilov
roject (linuxtesting.org). -- Alexey Khoroshilov Linux Verification Center, ISPRAS web: http://linuxtesting.org ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH v2] staging: r8188eu: Add _enter_critical_mutex() error handling

2015-10-17 Thread Alexey Khoroshilov
-by: Alexey Khoroshilov --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 5 +++-- drivers/staging/rtl8188eu/include/osdep_service.h | 9 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 ++- drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 5 - 4 files changed, 9

[PATCH] staging: r8188eu: Add _enter_critical_mutex() error handling

2015-10-09 Thread Alexey Khoroshilov
-by: Alexey Khoroshilov --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 5 +++-- drivers/staging/rtl8188eu/include/osdep_service.h | 9 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 ++- drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 5 - 4 files changed, 9

[PATCH] staging: ozwpan: implement error handling in ozwpan_init()

2015-03-20 Thread Alexey Khoroshilov
Errors are correctly handled in oz_cdev_register() and oz_protocol_init(), but then they are ignored in ozwpan_init(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/ozwpan/ozmain.c | 14 -- 1 file changed, 12

[PATCH] staging: vt6656: don't return zero on failure path in vt6656_probe()

2015-03-13 Thread Alexey Khoroshilov
If ieee80211_alloc_hw() fails in vt6656_probe(), it breaks off initialization, but returns zero. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/vt6656/main_usb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers

[PATCH] staging: lustre: do not ignore try_module_get() fail in obd_class_open()

2014-12-26 Thread Alexey Khoroshilov
obd_class_open() ignores error code of try_module_get(), while it can lead to race with module unload. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 3 +-- 1 file changed, 1

[PATCH] staging: dgnc: implement proper error handling in dgnc_start()

2014-12-19 Thread Alexey Khoroshilov
dgnc_start() ignores errors in class_create() and device_create() and it does not deallocate resources if dgnc_tty_preinit() fails. The patch implements proper error handling. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging

[PATCH] staging: gdm724x: fix leak at failure path in init_usb()

2014-07-10 Thread Alexey Khoroshilov
(linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/gdm724x/gdm_usb.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c index ee6e40facca7..ea89d530ff3f 100644 --- a/drivers

[PATCH] staging: line6: do not return 0 from probe if no initialization done

2014-06-10 Thread Alexey Khoroshilov
There is a strange "return 0" in line6_probe() before any initialization of the module is done. It can lead to NULL pointer dereference in other functions. The patch proposes to return -ENODEV in this case. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-

[PATCH 2/2] staging: dgap: implement proper error handling in dgap_start()

2014-03-08 Thread Alexey Khoroshilov
dgap_start() ignored errors in class_create() and device_create(). The patch implements proper error handling. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/dgap/dgap.c | 18 +- 1 file changed, 17 insertions

[PATCH 1/2] staging: dgap: remove unneeded status variables

2014-03-08 Thread Alexey Khoroshilov
ictable at any time. Also "dgap_downld" device was removed, while device_destroy(MKDEV(DIGI_DGAP_MAJOR, 1)) is still in dgap_cleanup_module(). The patch removes it by the way. Signed-off-by: Alexey Khoroshilov --- drivers/staging/dgap/dgap.c | 81 ++---

[PATCH 1/3] staging: dgap: remove unneeded status variables

2014-03-02 Thread Alexey Khoroshilov
ictable at any time. Signed-off-by: Alexey Khoroshilov --- drivers/staging/dgap/dgap.c | 97 - 1 file changed, 42 insertions(+), 55 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index cbce457..5271856 100644 ---

[PATCH 3/3] staging: dgap: fix error handling in dgap_init_module()

2014-03-02 Thread Alexey Khoroshilov
No need to call pci_unregister_driver() if pci_register_driver() failed. Signed-off-by: Alexey Khoroshilov --- drivers/staging/dgap/dgap.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index b4157d7

[PATCH 2/3] staging: dgap: implement proper error handling in dgap_start()

2014-03-02 Thread Alexey Khoroshilov
dgap_start() ignored errors in class_create() and device_create(). The patch implements proper error handling. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/dgap/dgap.c | 22 -- 1 file changed, 20

[PATCH 3/3] staging: dgap: fix error handling in dgap_init_module()

2014-02-23 Thread Alexey Khoroshilov
No need to call pci_unregister_driver() if pci_register_driver() failed. Signed-off-by: Alexey Khoroshilov --- drivers/staging/dgap/dgap_driver.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/staging/dgap/dgap_driver.c b/drivers/staging/dgap

[PATCH 2/3] staging: dgap: implement proper error handling in dgap_start()

2014-02-23 Thread Alexey Khoroshilov
dgap_start() ignored errors in class_create() and device_create(). The patch implements proper error handling. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/dgap/dgap_driver.c | 42 +++--- 1

[PATCH 1/3] staging: dgap: remove unneeded status variables

2014-02-23 Thread Alexey Khoroshilov
ictable at any time. Signed-off-by: Alexey Khoroshilov --- drivers/staging/dgap/dgap_driver.c | 105 - 1 file changed, 46 insertions(+), 59 deletions(-) diff --git a/drivers/staging/dgap/dgap_driver.c b/drivers/staging/dgap/dgap_driver.c index 089d017fc291..d7

[PATCH] staging: gdm72xx: fix leaks at failure path in gdm_usb_probe()

2014-02-05 Thread Alexey Khoroshilov
Error handling code in gdm_usb_probe() misses to deallocate tx_ and rx_structs and to do usb_put_dev(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/gdm72xx/gdm_usb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a

[PATCH] staging: wlan-ng: fix leaks on failure paths in prism2sta_probe_usb()

2014-01-10 Thread Alexey Khoroshilov
. hfa384x_destroy() is just noop in init state. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/wlan-ng/prism2usb.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wlan-ng/prism2usb.c b

[PATCH] [media] as102: fix leaks at failure paths in as102_usb_probe()

2013-12-27 Thread Alexey Khoroshilov
Failure handling is incomplete in as102_usb_probe(). The patch implements proper resource deallocations. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/media/as102/as102_usb_drv.c | 9 - 1 file changed, 8 insertions

[PATCH] [media] go7007-loader: fix usb_dev leak

2013-12-20 Thread Alexey Khoroshilov
There is usb_get_dev() in go7007_loader_probe(), but there is no usb_put_dev() anywhere. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/media/go7007/go7007-loader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH] staging: gdm724x: fix leak at failure path in gdm_usb_probe()

2013-11-15 Thread Alexey Khoroshilov
und by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/gdm724x/gdm_usb.c | 40 +-- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/stag

[PATCH 2/2] staging: gdm7240: fix memory leak on failure path

2013-10-08 Thread Alexey Khoroshilov
init_usb() may fail after some of mux_rxes already allocated. So we need to release them on the failure path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/gdm724x/gdm_mux.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH 1/2] staging: gdm7240: alloc_mux_rx() does not need GFP_ATOMIC

2013-10-08 Thread Alexey Khoroshilov
As far as alloc_mux_rx() is called from probe() only there is no need in GFP_ATOMIC here. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/gdm724x/gdm_mux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff