[PATCH] uwb: fix uwb_dev_unlock() missed at an error path in uwb_rc_cmd_async()

2012-11-26 Thread Alexey Khoroshilov
There is the only path in uwb_rc_cmd_async() where rc->uwb_dev is left unlocked. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/uwb/reset.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/uwb/reset.c b/drivers/

[PATCH 2/2] pcmcia: synclink_cs: cleanup checkpatch warnings

2013-02-06 Thread Alexey Khoroshilov
ERROR: open brace '{' following struct go on the same line ERROR: space required after that ',' ERROR: space prohibited after that open parenthesis '(' WARNING: please, no spaces at the start of a line WARNING: please, no space before tabs Signed-off-by: Alexey

[PATCH] staging: dgrp: implement error handling in dgrp_create_class_sysfs_files()

2013-04-05 Thread Alexey Khoroshilov
There is no any error handling in dgrp_create_class_sysfs_files(). The patch adds code to check return values and propagate them to dgrp_init_module(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/dgrp/dgrp_common.h

[PATCH] stmmac: don't return zero on failure path in stmmac_pci_probe()

2013-02-01 Thread Alexey Khoroshilov
If stmmac_dvr_probe() fails in stmmac_pci_probe(), it breaks off initialization, deallocates all resources, but returns zero. The patch adds -ENODEV as return value in this case. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net

[PATCH] mwifiex: don't return zero on failure paths in mwifiex_pcie_init()

2013-01-25 Thread Alexey Khoroshilov
If pci_iomap() fails in mwifiex_pcie_init(), it breaks off initialization, deallocates all resources, but returns zero. The patch adds -EIO as return value in this case. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/wireless

[PATCH v2] tty: mxser: improve error handling in mxser_probe() and mxser_module_init()

2013-02-18 Thread Alexey Khoroshilov
free_irq() from mxser_release_ISA_res() to mxser_board_remove(), since it makes mxser_release_ISA_res() a counterpart for mxser_get_ISA_conf(), while free_irq() is relevant to both ISA and PCI boards. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov

[PATCH] [media] stv090x: do not unlock unheld mutex in stv090x_sleep()

2013-02-19 Thread Alexey Khoroshilov
goto err and goto err_gateoff before mutex_lock(&state->internal->demod_lock) lead to unlock of unheld mutex in stv090x_sleep(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/dvb-frontends/stv090

Re: [PATCH] [media] stv090x: do not unlock unheld mutex in stv090x_sleep()

2013-02-20 Thread Alexey Khoroshilov
On 02/20/2013 10:58 AM, Manu Abraham wrote: > Hi, > > On Wed, Feb 20, 2013 at 12:28 AM, Alexey Khoroshilov > wrote: >> goto err and goto err_gateoff before mutex_lock(&state->internal->demod_lock) >> lead to unlock of unheld mutex in stv090x_sleep(). > Out of

[PATCH] [SCSI] scsi_dh_hp_sw: return -ENOMEM if kzalloc() failed

2013-02-22 Thread Alexey Khoroshilov
If kzalloc() failed, hp_sw_bus_attach() breaks off initialization, but returns zero. The patch adds -ENOMEM as return value in this case. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/scsi/device_handler/scsi_dh_hp_sw.c |2

[PATCH] usb: cdc-acm: fix error handling in acm_probe()

2013-03-15 Thread Alexey Khoroshilov
acm_probe() ignores errors in tty_port_register_device() and leaves intfdata pointing to freed memory on alloc_fail7 error path. The patch fixes the both issues. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/usb/class/cdc-acm.c

[PATCH v2] [SCSI] mpt2sas: fix double mutex lock in NON_BLOCKING state

2012-08-28 Thread Alexey Khoroshilov
: Alexey Khoroshilov --- drivers/scsi/mpt2sas/mpt2sas_ctl.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c index 49bdd2d..d29ea56 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c +++ b/drivers

[PATCH] virtio: console: fix error handling in init() function

2012-09-01 Thread Alexey Khoroshilov
If register_virtio_driver() fails, virtio-ports class is not destroyed. The patch adds error handling of register_virtio_driver(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/char/virtio_console.c | 12 +++- 1 file

[PATCH] ppdev: ppdev_init: do not return zero in case of failure

2012-09-01 Thread Alexey Khoroshilov
). Signed-off-by: Alexey Khoroshilov --- drivers/char/ppdev.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 3fcf80f..d0d824e 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -783,7 +783,8 @@ static int __init

[PATCH] staging: bcm: fix error handling in bcm_init()

2012-09-01 Thread Alexey Khoroshilov
bcm_init() does not have proper error handling of usb_register(). The patch implements one. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/bcm/InterfaceInit.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion

[PATCH v2] staging: bcm: fix error handling in bcm_init()

2012-09-02 Thread Alexey Khoroshilov
bcm_init() does not have proper error handling of usb_register(). The patch implements one. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/bcm/InterfaceInit.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion

[PATCH] staging: bcm: use pr_info and pr_err rather than printk

2012-09-02 Thread Alexey Khoroshilov
Convert printk(KERN_INFO to pr_info( and printk(KERN_ERR to pr_err(. Signed-off-by: Alexey Khoroshilov --- drivers/staging/bcm/InterfaceInit.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/bcm/InterfaceInit.c b/drivers/staging/bcm

[PATCH] USB: omninet: fix potential tty NULL dereference

2012-09-13 Thread Alexey Khoroshilov
Add check for return value of tty_port_tty_get, since it can return NULL after port hangup that may happen anytime. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/usb/serial/omninet.c |8 +--- 1 file changed, 5 insertions

[PATCH] pcmcia: synclink_cs: fix potential tty NULL dereference

2012-09-13 Thread Alexey Khoroshilov
tty_port_tty_get() can return NULL after port hangup that may happen anytime. The patch adds checks that tty_port_tty_get() returns nonNULL around places where tty is actually used. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers

[PATCH v2] pcmcia: synclink_cs: fix potential tty NULL dereference

2012-09-14 Thread Alexey Khoroshilov
handling updated according Alan Cox feedback. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/char/pcmcia/synclink_cs.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/char/pcmcia

[PATCH] extcon: arizona: unlock mutex on error path in arizona_micdet()

2012-11-04 Thread Alexey Khoroshilov
If regmap_read() failed, arizona_micdet() returns IRQ_NONE leaving &info->lock mutex locked as opposed to all other return paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/extcon/extcon-arizona.c |1 + 1 file cha

[PATCH] jffs2: Make handling of erase_completion_lock consistent in jffs2_do_reserve_space()

2012-11-05 Thread Alexey Khoroshilov
Users of jffs2_do_reserve_space() expect they still held erase_completion_lock after call to it. But there is a path where jffs2_do_reserve_space() leaves erase_completion_lock unlocked. The patch fixes it. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey

[PATCH] staging/gdm72xx: coding style fixes gdm_qos.c

2012-09-25 Thread Alexey Khoroshilov
Fix checkpatch.pl warnings: WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ... WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ... WARNING: Prefer pr_err(... to printk(KERN_ERR, ... Signed-off-by: Alexey Khoroshilov --- drivers/staging/gdm72xx/gdm_qos.c |6 +++--- 1 file changed, 3

[PATCH] staging: sbe-2t3e3: fix error handling in t3e3_init_channel()

2012-09-25 Thread Alexey Khoroshilov
t3e3_init_channel() incorrectly handles errors in several places: it returns zero and does not deallocate all required resources. The patch fixes that places. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/sbe-2t3e3/module.c

[PATCH] [media] dvb-usb: fix error handling in ttusb_dec_probe()

2013-07-13 Thread Alexey Khoroshilov
done with GFP_KERNEL; - refactors ttusb_dec_boot_dsp() in an equivalent way except for returning 0 instead of 1 if ttusb_dec_boot_dsp() succeed in (!mode) branch. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/usb/ttusb-dec

[PATCH] p54usb: fix leak at failure path in p54u_load_firmware()

2013-09-17 Thread Alexey Khoroshilov
If request_firmware_nowait() fails in p54u_load_firmware(), p54u_load_firmware_cb is not called and no one decrements usb_dev refcnt. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/wireless/p54/p54usb.c | 1 + 1 file changed, 1

[PATCH] can: pcan_usb_core: fix memory leak on failure paths in peak_usb_start()

2013-09-04 Thread Alexey Khoroshilov
Tx and rx urbs are not deallocated if something goes wrong in peak_usb_start(). The patch fixes error handling to deallocate all the resources. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/can/usb/peak_usb/pcan_usb_core.c | 15

[PATCH] net/irda/mcs7780: fix memory leaks in mcs_net_open()

2013-09-12 Thread Alexey Khoroshilov
: Alexey Khoroshilov --- drivers/net/irda/mcs7780.c | 40 +++- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index f07c340..3f138ca 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda

[PATCH v2] [media] dvb_demux: fix deadlock in dmx_section_feed_release_filter()

2013-10-07 Thread Alexey Khoroshilov
er Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/dvb-core/dvb_demux.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-core/dvb_demux.c b/drivers/media/dvb-core/dvb_demux.c index 3485655..6de3bd0 100644 ---

[PATCH] [media] cx231xx: fix double free and leaks on failure path in cx231xx_usb_probe()

2013-10-07 Thread Alexey Khoroshilov
just a few of them. The patch fixes the issues in cx231xx_usb_probe() and cx231xx_init_dev() by moving usb_get_dev(interface_to_usbdev(interface)) below in code and implementing proper error handling. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov

[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

[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] rtl8187: fix use after free on failure path in rtl8187_init_urbs()

2013-08-31 Thread Alexey Khoroshilov
implements error handling of init_urbs in rtl8187_start(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/wireless/rtl818x/rtl8187/dev.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/ne

Re: [PATCH] rtl8187: fix use after free on failure path in rtl8187_init_urbs()

2013-09-01 Thread Alexey Khoroshilov
On 01.09.2013 10:51, Hin-Tak Leung wrote: -- On Sat, Aug 31, 2013 22:18 BST Alexey Khoroshilov wrote: In case of __dev_alloc_skb() failure rtl8187_init_urbs() calls usb_free_urb(entry) where 'entry' can points to urb allocated at the previous iteration.

Re: [PATCH] rtl8187: fix use after free on failure path in rtl8187_init_urbs()

2013-09-03 Thread Alexey Khoroshilov
On 02.09.2013 10:34, Hin-Tak Leung wrote: -- On Mon, Sep 2, 2013 05:06 BST Alexey Khoroshilov wrote: On 01.09.2013 10:51, Hin-Tak Leung wrote: -- On Sat, Aug 31, 2013 22:18 BST Alexey Khoroshilov wrote: In case of __dev_alloc_skb

[PATCH v2] rtl8187: fix use after free on failure path in rtl8187_init_urbs()

2013-09-03 Thread Alexey Khoroshilov
implements error handling of init_urbs in rtl8187_start(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/wireless/rtl818x/rtl8187/dev.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/ne

[PATCH] carl9170: fix leaks at failure path in carl9170_usb_probe()

2013-09-27 Thread Alexey Khoroshilov
carl9170_usb_probe() does not handle request_firmware_nowait() failure that leads to several leaks in this case. The patch adds all required deallocations. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/wireless/ath/carl9170

Re: [PATCH] carl9170: fix leaks at failure path in carl9170_usb_probe()

2013-09-27 Thread Alexey Khoroshilov
On 28.09.2013 00:17, Fabio Estevam wrote: On Sat, Sep 28, 2013 at 12:51 AM, Alexey Khoroshilov wrote: - return request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME, + err = request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME, &ar->udev->dev, GFP_

[PATCH] p54pci: don't return zero on failure path in p54p_probe()

2013-01-01 Thread Alexey Khoroshilov
If pci_set_dma_mask() or pci_set_consistent_dma_mask() fails in p54p_probe(), it breaks off initialization, deallocates all resources, but returns zero. The patch implements proper error code propagation. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey

Re: [PATCH] p54pci: don't return zero on failure path in p54p_probe()

2013-01-01 Thread Alexey Khoroshilov
On 01/02/2013 01:45 AM, Christian Lamparter wrote: On Tuesday 01 January 2013 22:11:01 Alexey Khoroshilov wrote: If pci_set_dma_mask() or pci_set_consistent_dma_mask() fails in p54p_probe(), it breaks off initialization, deallocates all resources, but returns zero. The patch implements proper

[PATCH v2] p54pci: don't return zero on failure paths in p54p_probe()

2013-01-02 Thread Alexey Khoroshilov
Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Acked-by: Christian Lamparter --- drivers/net/wireless/p54/p54pci.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c

[PATCH] mei: fix mismatch in mutex unlock-lock in mei_amthif_read()

2012-12-21 Thread Alexey Khoroshilov
ned-off-by: Alexey Khoroshilov --- drivers/misc/mei/amthif.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c index 18794ae..e40ffd9 100644 --- a/drivers/misc/mei/amthif.c +++ b/drivers/misc/mei/amthif.c @@ -187,13 +187

[PATCH] e1000e: fix mismatch in mutex lock-unlock in e1000_reset_hw_82571()

2013-04-18 Thread Alexey Khoroshilov
Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/ethernet/intel/e1000e/82571.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c index

[PATCH] ext4: unregister extents status shrinker if mount failed

2013-04-19 Thread Alexey Khoroshilov
If ext4_fill_super() failed after extents status shrinker has been registered, the shrinker is left in a global list while the memory, it sits in, is already freed. Oops is not so bad scenario after that. Found by Linux File System Verification project (linuxtesting.org). Signed-off-by: Alexey

[PATCH] orinoco_usb: fix memory leak in ezusb_access_ltv() when device disconnected

2013-06-13 Thread Alexey Khoroshilov
rification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/wireless/orinoco/orinoco_usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c index 1f9cb55..bdfe

[PATCH] USB: fix PTR_ERR translation in init_usb_class()

2013-06-05 Thread Alexey Khoroshilov
There is a misprint in init_usb_class(): IS_ERR is used to get error code instead of PTR_ERR. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/usb/core/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH] tty/serial/sirf: fix error propagation in sirfsoc_uart_probe()

2013-06-05 Thread Alexey Khoroshilov
If pinctrl_get_select_default() fails, sirfsoc_uart_probe() returns IS_ERR(result) instead of PTR_ERR(result). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/tty/serial/sirfsoc_uart.c | 5 +++-- 1 file changed, 3 insertions(+), 2

[PATCH] GFS2: fix error propagation in init_threads()

2013-06-05 Thread Alexey Khoroshilov
If kthread_run() fails, init_threads() returns IS_ERR(p) instead of PTR_ERR(p). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- fs/gfs2/ops_fstype.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/gfs2

[PATCH] spi/sirf: fix error propagation in spi_sirfsoc_probe()

2013-06-05 Thread Alexey Khoroshilov
If pinctrl_get_select_default() fails, spi_sirfsoc_probe() returns IS_ERR(sspi->p) instead of PTR_ERR(sspi->p). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/spi/spi-sirf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 del

[PATCH] GFS2: minor readability improvement in gfs2_mount()

2013-06-05 Thread Alexey Khoroshilov
The patch makes usage pattern of IS_ERR-PTR_ERR more typical. Signed-off-by: Alexey Khoroshilov --- fs/gfs2/ops_fstype.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 0262c19..0d30e8e 100644 --- a/fs/gfs2/ops_fstype.c

Re: [PATCH] GFS2: minor readability improvement in gfs2_mount()

2013-06-06 Thread Alexey Khoroshilov
Hi Steve, On 06/06/2013 01:24 PM, Steven Whitehouse wrote: > Hi, > > On Thu, 2013-06-06 at 01:29 +0400, Alexey Khoroshilov wrote: >> The patch makes usage pattern of IS_ERR-PTR_ERR more typical. >> >> Signed-off-by: Alexey Khoroshilov >> --- >> fs/gfs2/op

[PATCH] [media] go7007: fix return 0 for unsupported devices in go7007_usb_probe()

2013-06-19 Thread Alexey Khoroshilov
probe() should not return 0 for unsupported devices, but go7007_usb_probe() does. The patch fixes it to return -ENODEV. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/media/go7007/go7007-usb.c | 4 ++-- 1 file changed, 2

[PATCH] usb: gadget: r8a66597-udc: do not unlock unheld spinlock in r8a66597_sudmac_irq()

2013-05-29 Thread Alexey Khoroshilov
e patch just moves locking before calling r8a66597_sudmac_irq(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/usb/gadget/r8a66597-udc.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/r8

[PATCH] staging/media: lirc_imon: fix leaks in imon_probe()

2013-06-02 Thread Alexey Khoroshilov
-by: Alexey Khoroshilov --- drivers/staging/media/lirc/lirc_imon.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index 0a2c45d..4afa7da 100644 --- a/drivers/staging/media/lirc/lirc_imon.c

[PATCH 1/2] [media] tlg2300: implement error handling in poseidon_probe()

2013-06-24 Thread Alexey Khoroshilov
All poseidon init functions properly return error codes, but they are ignored by poseidon_probe(). The patch implements handling of error cases. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/usb/tlg2300/pd-main.c | 27

[PATCH 2/2] [media] tlg2300: fix checking firmware in poseidon_probe()

2013-06-24 Thread Alexey Khoroshilov
strange, so the patch removes down_firmware argument of check_firmware() and returns error code if check_firmware() fails in poseidon_probe(). Not tested on real hardware. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/usb

[PATCH] staging: ft1000: fix memory leak on error path in ft1000_probe()

2013-06-10 Thread Alexey Khoroshilov
Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/

[PATCH] [media] ttusb-budget: fix memory leak in ttusb_probe()

2013-06-10 Thread Alexey Khoroshilov
If something goes wrong starting from i2c_add_adapter(), ttusb->iso_urb[] and ttusb itself are not deallocated. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c | 2 ++ 1 file changed

[PATCH] [media] usbvision-video: fix memory leak of alt_max_pkt_size

2013-06-10 Thread Alexey Khoroshilov
pen there. It calls usbvision_release() if allocation of usbvision->alt_max_pkt_size fails as soon as usbvision_release() is safe to work with incompletely initialized usbvision structure. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drive

[PATCH] ath9k_htc: fix data race between request_firmware_nowait() callback and suspend()

2013-07-01 Thread Alexey Khoroshilov
ends this approach to suspend() as well. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/wireless/ath/ath9k/hif_usb.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c

[PATCH] [media] hdpvr: fix iteration over uninitialized lists in hdpvr_probe()

2013-07-03 Thread Alexey Khoroshilov
by the way fixes goto label in error handling of registering videodev. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/usb/hdpvr/hdpvr-core.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH] SUNRPC/cache: add module_put() on error path in cache_open()

2013-03-22 Thread Alexey Khoroshilov
If kmalloc() fails in cache_open(), module cd->owner left locked. The patch adds module_put(cd->owner) on this path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- net/sunrpc/cache.c |4 +++- 1 file changed, 3 insertions(+), 1 de

[PATCH] via-ircc: don't return zero if via_ircc_open() failed

2013-08-16 Thread Alexey Khoroshilov
Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/irda/via-ircc.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c index 51f2bc3..2dcc60f 100644 --- a/drivers/net/irda/via

[PATCH] [media] dvb_demux: fix deadlock in dmx_section_feed_release_filter()

2013-08-17 Thread Alexey Khoroshilov
g mutex. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/dvb-core/dvb_demux.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-core/dvb_demux.c b/drivers/media/dvb-core/dvb_demux.c inde

[PATCH] can: usb_8dev: fix urb leak on failure path in usb_8dev_start()

2013-07-17 Thread Alexey Khoroshilov
If usb_8dev_start() fails to submit urb, it unanchors the urb but forgets to free it. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/can/usb/usb_8dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/can/usb

[PATCH] libceph: fix deadlock in ceph_build_auth()

2013-07-28 Thread Alexey Khoroshilov
d_auth() calling it. ceph_auth_build_hello() is left with untouched semantics as a wrapper around ceph_build_hello_auth_request(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- net/ceph/auth.c | 17 + 1 file changed, 13 insertions

Re: [PATCH] usb: gadget: mv_u3d_core: fix violation of locking discipline in mv_u3d_ep_disable()

2013-07-29 Thread Alexey Khoroshilov
On 07/29/2013 04:52 PM, Felipe Balbi wrote: > Hi, > > On Fri, Jul 26, 2013 at 07:26:05PM +0400, Alexey Khoroshilov wrote: >> On 07/25/2013 09:30 PM, Felipe Balbi wrote: >>> On Wed, Jul 24, 2013 at 12:20:17AM +0400, Alexey Khoroshilov wrote: >>>> mv_u3d_nuke

[PATCH] usb: gadget: amd5536udc: unconditionally use GFP_ATOMIC in udc_queue()

2013-08-01 Thread Alexey Khoroshilov
As far as prep_dma() is called with spinlock held, we have to pass GFP_ATOMIC regardless of gfp argument. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/usb/gadget/amd5536udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH] hostap: do not return positive number on failure path in prism2_open()

2013-08-04 Thread Alexey Khoroshilov
prism2_open() as an .ndo_open handler should not return positive numbers in case of failure, but it does return 1 in a couple of places. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/wireless/hostap/hostap_main.c | 4 ++-- 1

Re: [PATCH] hostap: do not return positive number on failure path in prism2_open()

2013-08-04 Thread Alexey Khoroshilov
Please ignore this mail, there is a misprint in signed-off line. I will resend the patch. On 08/05/2013 07:02 AM, Alexey Khoroshilov wrote: > prism2_open() as an .ndo_open handler should not return positive numbers > in case of failure, but it does return 1 in a couple of places. > &

[PATCH] hostap: do not return positive number on failure path in prism2_open()

2013-08-04 Thread Alexey Khoroshilov
prism2_open() as an .ndo_open handler should not return positive numbers in case of failure, but it does return 1 in a couple of places. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/wireless/hostap/hostap_main.c | 4 ++-- 1

Re: [PATCH] hostap: do not return positive number on failure path in prism2_open()

2013-08-04 Thread Alexey Khoroshilov
On 08/05/2013 07:33 AM, Joe Perches wrote: > On Mon, 2013-08-05 at 07:18 +0400, Alexey Khoroshilov wrote: >> prism2_open() as an .ndo_open handler should not return positive numbers >> in case of failure, but it does return 1 in a couple of places. >> >> Found by Linux

[PATCH] [media] gspca: fix dev_open() error path

2013-08-05 Thread Alexey Khoroshilov
If v4l2_fh_open() fails in dev_open(), gspca_dev->module left locked. The patch adds module_put(gspca_dev->module) on this path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/usb/gspca/gspca.c | 6 +- 1 file chan

[PATCH] usb: gadget: mv_u3d_core: fix violation of locking discipline in mv_u3d_ep_disable()

2013-07-23 Thread Alexey Khoroshilov
mv_u3d_nuke() expects to be calles with ep->u3d->lock held, because mv_u3d_done() does. But mv_u3d_ep_disable() calls it without lock that can lead to unpleasant consequences. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drive

Re: [PATCH] usb: gadget: mv_u3d_core: fix violation of locking discipline in mv_u3d_ep_disable()

2013-07-26 Thread Alexey Khoroshilov
Hi Felipe, On 07/25/2013 09:30 PM, Felipe Balbi wrote: > On Wed, Jul 24, 2013 at 12:20:17AM +0400, Alexey Khoroshilov wrote: >> mv_u3d_nuke() expects to be calles with ep->u3d->lock held, >> because mv_u3d_done() does. But mv_u3d_ep_disable() calls it >> without lock

[PATCH] drbd: add module_put() on error path in drbd_proc_open()

2013-03-01 Thread Alexey Khoroshilov
If single_open() fails in drbd_proc_open(), module refcount is left incremented. The patch adds module_put() on the error path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/block/drbd/drbd_proc.c | 10 -- 1 file changed

[PATCH 0/2] ext4: deadlocks after allocation failure in ext4_init_io_end()

2013-05-13 Thread Alexey Khoroshilov
). -- Alexey Khoroshilov Linux Verification Center, ISPRAS web: http://linuxtesting.org [ 1212.454601] Failure is simulated in the following location [ 1212.454675] Call Trace: [ 1212.454681] [] dump_stack+0x19/0x1b [ 1212.454687] [] warn_slowpath_common+0x70/0xa0 [ 1212.454691] [] ? indicator_simulate

[PATCH 1/2] ext4: do not left pages locked in mpage_da_submit_io()

2013-05-13 Thread Alexey Khoroshilov
(linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- fs/ext4/inode.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 793d44b..aeca439 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1489,8 +1489,9

[PATCH 2/2] ext4: do not left pages locked in ext4_writepage()

2013-05-13 Thread Alexey Khoroshilov
). Signed-off-by: Alexey Khoroshilov --- fs/ext4/inode.c |1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index aeca439..c6bc999 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2250,6 +2250,7 @@ static int ext4_writepage(struct page *page

Re: [PATCH] hfs: add error checking for hfs_find_init()

2013-04-06 Thread Alexey Khoroshilov
Hi Vyacheslav, On 03/30/2013 03:35 PM, Vyacheslav Dubeyko wrote: Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- fs/hfs/catalog.c | 12 +--- fs/hfs/dir.c |8 ++-- fs/hfs/extent.c | 48

[PATCH] tty: mxser: fix cycle termination condition in mxser_probe() and mxser_module_init()

2013-04-07 Thread Alexey Khoroshilov
There is a bug in resources deallocation code in mxser_probe() and mxser_module_init(). As soon as variable 'i' is unsigned int, cycle termination condition i >= 0 is always true. The patch fixes the issue. Signed-off-by: Alexey Khoroshilov --- drivers/tty/mxser.c |8 +++

[PATCH 1/2] hfsplus: add error propagation to __hfsplus_ext_write_extent()

2013-04-07 Thread Alexey Khoroshilov
__hfsplus_ext_write_extent() suppresses errors coming from hfs_brec_find(). The patch implements error code propagation. Signed-off-by: Alexey Khoroshilov --- fs/hfsplus/extents.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/fs/hfsplus/extents.c b

[PATCH 2/2] hfsplus: add printk to log allocation failure in hfs_find_init()

2013-04-07 Thread Alexey Khoroshilov
Add printk to log allocation failure in hfs_find_init(), "so that there is a sign in dmesg when the error condition is triggered". (per Hin-Tak Leung request) Signed-off-by: Alexey Khoroshilov --- fs/hfsplus/bfind.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

Re: [patch] tty: mxser: forever loops on error

2013-04-08 Thread Alexey Khoroshilov
Hi Dan, Thank you for the patch. We are also trying to fix the issue: https://lkml.org/lkml/2013/2/19/29 https://lkml.org/lkml/2013/4/8/55 and the fix is finally in Greg's tty git tree since yesterday: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git (tty-linus branch). Best reg

[PATCH 1/2] hfs: add error checking for hfs_find_init()

2013-04-09 Thread Alexey Khoroshilov
Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- fs/hfs/catalog.c | 12 +--- fs/hfs/dir.c |8 ++-- fs/hfs/extent.c | 48 +--- fs/hfs/hfs_fs.h |2 +- fs/hfs/inode.c | 11 +-- fs/hfs/super.c

[PATCH 2/2] hfsplus: add error propagation to __hfsplus_ext_write_extent()

2013-04-09 Thread Alexey Khoroshilov
__hfsplus_ext_write_extent() suppresses errors coming from hfs_brec_find(). The patch implements error code propagation. Signed-off-by: Alexey Khoroshilov --- fs/hfsplus/extents.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/fs/hfsplus/extents.c b

[PATCH] ext4: implement error handling of ext4_mb_new_preallocation()

2013-05-05 Thread Alexey Khoroshilov
t4_mb_new_preallocation() error code and handles its failure as if ext4_mb_regular_allocator() fails. Found by Linux File System Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- fs/ext4/mballoc.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-)

[PATCH] [media] wl128x: do not call copy_to_user() while holding spinlocks

2013-05-07 Thread Alexey Khoroshilov
Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/radio/wl128x/fmdrv_common.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio

[PATCH] staging: wlags49_h2: fix error handling in pcmcia probe function

2013-04-23 Thread Alexey Khoroshilov
wl_adapter_attach() ignores some important issues such as register_netdev() failure. The patch fixes it. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/wlags49_h2/wl_cs.c | 13 - drivers/staging/wlags49_h2

[PATCH] [media] cx88: Fix unsafe locking in suspend-resume

2013-04-13 Thread Alexey Khoroshilov
and cx8802_irq. That means a deadlock is possible if an interrupt happens while suspend or resume owns the lock. The patch replaces spin_lock/spin_unlock with spin_lock_irqsave/spin_unlock_irqrestore. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshi

[PATCH] hfs: add error checking for hfs_find_init()

2013-03-29 Thread Alexey Khoroshilov
Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- fs/hfs/catalog.c | 12 +--- fs/hfs/dir.c |8 ++-- fs/hfs/extent.c | 48 +--- fs/hfs/hfs_fs.h |2 +- fs/hfs/inode.c | 11 +-- fs/hfs/super.c

[PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device

2013-03-08 Thread Alexey Khoroshilov
be safely used between usb_lock_device() and usb_unlock_device(). Replace by GFP_NOIO. The patch fixes the same issue in usb/core/devio.c. All the allocations fixed are under usb_lock_device() from usbdev_do_ioctl(). Found by Linux Driver Verification project (linuxtesting.org). Signed

[RESEND PATCH] [SCSI] mpt2sas: fix double mutex lock in NON_BLOCKING state

2012-08-24 Thread Alexey Khoroshilov
If state is NON_BLOCKING and mutex_trylock is succeed, the control flow goes to mutex_lock_interruptible() that is a deadlock. Found by Linux Driver Verification project (linuxtesting.org). Acked-by: "Nandigama, Nagalakshmi" Signed-off-by: Alexey Khoroshilov --- drivers/sc

[PATCH] drm/edid: Fix potential memory leak in edid_load()

2012-08-07 Thread Alexey Khoroshilov
Do not leak memory by updating pointer with potentially NULL realloc return value. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/gpu/drm/drm_edid_load.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a

[PATCH] iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode()

2012-08-07 Thread Alexey Khoroshilov
Do not leak memory by updating pointer with potentially NULL realloc return value. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/iio/light/adjd_s311.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff

[PATCH] USB: whci-hcd: Fix potential memory leak in qset_add_urb_sg()

2012-08-08 Thread Alexey Khoroshilov
(linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/usb/host/whci/qset.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/whci/qset.c b/drivers/usb/host/whci/qset.c index 76083ae..dc31c42 100644 --- a/drivers/usb/host/whci/qset.c +++ b

Re: [PATCH] iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode()

2012-08-08 Thread Alexey Khoroshilov
return -ENOMEM; > > I suggest to switch back to that original code, there is no need preserve > the data in the buffer as krealloc does That is fine. >> Found by Linux Driver Verification project (linuxtesting.org). >> >> Signed-off-by: Alexey Khoroshilov >&g

[PATCH v2] iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode()

2012-08-08 Thread Alexey Khoroshilov
Do not leak memory by updating pointer with potentially NULL realloc return value. There is no need to preserve data in the buffer, so replace krealloc() by kfree()-kmalloc() pair. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/iio

[PATCH] net/core: Fix potential memory leak in dev_set_alias()

2012-08-08 Thread Alexey Khoroshilov
Do not leak memory by updating pointer with potentially NULL realloc return value. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- net/core/dev.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/core/dev.c b

[PATCH] wusb: Fix potential memory leak in wusb_dev_sec_add()

2012-08-08 Thread Alexey Khoroshilov
Do not leak memory by updating pointer with potentially NULL realloc return value. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/usb/wusbcore/security.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a

[PATCH] can/softing: Fix potential memory leak in softing_load_fw()

2012-08-08 Thread Alexey Khoroshilov
Do not leak memory by updating pointer with potentially NULL realloc return value. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/can/softing/softing_fw.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff

  1   2   3   4   5   >