[PATCH] media: tc358743: release device_node in tc358743_probe_of()

2018-05-25 Thread Alexey Khoroshilov
of_graph_get_next_endpoint() returns device_node with refcnt increased, but these is no of_node_put() for it. The patch adds one on error and normal paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers

[PATCH] ir-hix5hd2: fix error handling of clk_prepare_enable()

2018-01-26 Thread Alexey Khoroshilov
Return code of clk_prepare_enable() is ignored in many places. The patch adds error handling for all of them. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/media/rc/ir-hix5hd2.

media: tc358743: clk_disable_unprepare(refclk) missed

2018-01-12 Thread Alexey Khoroshilov
to keep clk easily available? Found by Linux Driver Verification project (linuxtesting.org). -- Alexey Khoroshilov Linux Verification Center, ISPRAS web: http://linuxtesting.org

[PATCH] [media] v4l: mt9v032: Disable clock on error paths

2017-11-24 Thread Alexey Khoroshilov
mt9v032_power_on() leaves clk enabled in case of errors, but it is not expected by its callers. There is a similar problem in mt9v032_registered(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/med

[PATCH] m2m-deinterlace: don't return zero on failure paths in deinterlace_probe()

2017-04-07 Thread Alexey Khoroshilov
If DMA does not support INTERLEAVE, deinterlace_probe() breaks off initialization, releases dma channel, but returns zero. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/media/platform/m2m-deinterlace

[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 web: http://linuxtesting.org

[BUG] au0828: dev->lock in au0828_usb_probe()

2016-06-22 Thread Alexey Khoroshilov
dev could be already freed. Otherwise, dev->lock should not be acquired so early. Another problem is that on the path going via goto done there is no mutex_unlock(>lock). Found by Linux Driver Verification project (linuxtesting.org). -- Alexey Khoroshilov Linux Verification Center, I

[PATCH] [media] radio-maxiradio: fix memory leak when device is removed

2016-06-03 Thread Alexey Khoroshilov
Memory allocated for maxiradio device is not deallocated when the device is removed. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/media/radio/radio-maxiradio.c | 1 + 1 file changed, 1 insertion(+)

[PATCH] [media] au0828: fix double free in au0828_usb_probe()

2016-04-22 Thread Alexey Khoroshilov
). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/media/usb/au0828/au0828-video.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 32d7db96479c..7d0ec4cb248c 100644 --- a/drivers/med

[PATCH] [media] bt8xx: remove needless module refcounting

2016-04-08 Thread Alexey Khoroshilov
It is responsibility of a caller of fops->open(), to make sure an owner of the fops is available until file is closed. So, there is no need to lock THIS_MODULE explicitly. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@isp

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

2015-11-14 Thread Alexey Khoroshilov
g.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> 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/s

Re: [PATCH] [media] marvell-ccic: fix memory leak on failure path in cafe_smbus_setup()

2015-04-04 Thread Alexey Khoroshilov
On 04.04.2015 16:36, Jonathan Corbet wrote: On Sat, 4 Apr 2015 03:16:01 +0300 Alexey Khoroshilov khoroshi...@ispras.ru wrote: If i2c_add_adapter() fails, adap is not deallocated. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi

[PATCH] [media] marvell-ccic: fix memory leak on failure path in cafe_smbus_setup()

2015-04-03 Thread Alexey Khoroshilov
If i2c_add_adapter() fails, adap is not deallocated. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/platform/marvell-ccic/cafe-driver.c | 12 1 file changed, 8 insertions(+), 4 deletions

[PATCH] [media] usbvision: fix leak of usb_dev on failure paths in usbvision_probe()

2015-03-27 Thread Alexey Khoroshilov
There is no usb_put_dev() on failure paths in usbvision_probe(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/usb/usbvision/usbvision-video.c | 24 +--- 1 file changed, 17 insertions

[PATCH] sh_vou: fix memory leak on error paths in sh_vou_open()

2015-02-13 Thread Alexey Khoroshilov
Memory allocated for sh_vou_file is not deallocated on error paths in sh_vou_open(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/platform/sh_vou.c | 9 ++--- 1 file changed, 6 insertions(+), 3

[PATCH] [media] cx231xx: fix usbdev leak on failure paths in cx231xx_usb_probe()

2015-01-16 Thread Alexey Khoroshilov
). So the patch moves usb_get_dev() below (before the first use) and fixes another failure path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/usb/cx231xx/cx231xx-cards.c | 7 --- 1 file changed, 4

[PATCH] [media] imon: fix usbdev leaks

2014-09-15 Thread Alexey Khoroshilov
-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/rc/imon.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 7115e68ba697..06ff61ec3e1e 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -2181,6 +2181,7

Re: [PATCH] [media] mceusb: fix usbdev leak

2014-09-10 Thread Alexey Khoroshilov
On 09.09.2014 14:39, Sean Young wrote: On Tue, Sep 09, 2014 at 02:10:43AM +0400, Alexey Khoroshilov wrote: mceusb_init_rc_dev() does usb_get_dev(), but there is no any usb_put_dev() in the driver. drivers/media/rc/imon.c suffers from the same problem. Thanks Sean Yes, our static analyzers

[PATCH] [media] mceusb: fix usbdev leak

2014-09-08 Thread Alexey Khoroshilov
(linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/rc/mceusb.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 45b0894288e5..23e532da0cf7 100644 --- a/drivers

[PATCH] [media] tlg2300: fix leak at failure path in poseidon_probe()

2014-05-30 Thread Alexey Khoroshilov
Error handling code in poseidon_probe() misses usb_put_intf() and usb_put_dev(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/usb/tlg2300/pd-main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH] [media] usbtv: fix leak at failure path in usbtv_probe()

2014-05-23 Thread Alexey Khoroshilov
Error handling code in usbtv_probe() misses usb_put_dev(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/usb/usbtv/usbtv-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/usb

[PATCH] [media] ivtv: avoid GFP_KERNEL in atomic context

2014-04-25 Thread Alexey Khoroshilov
() [ATOMIC CONTEXT] - ivtv_yuv_udma_stream_frame() [with mutex held] - ivtv_write() [with mutex held] The patch adds gfp_t argument and implements its usage according to the context. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi

[PATCH] [media] adv7180: free an interrupt on failure paths in init_device()

2014-03-14 Thread Alexey Khoroshilov
There is request_irq() in init_device(), but the interrupt is not removed on failure paths. The patch adds proper error handling. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/i2c/adv7180.c | 18

[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 khoroshi...@ispras.ru --- drivers/staging/media/as102/as102_usb_drv.c | 9 - 1 file

[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 khoroshi...@ispras.ru --- drivers/staging/media/go7007/go7007-loader.c | 4 +++- 1 file changed, 3 insertions

[PATCH] cxusb: fix mismatch in mutex lock-unlock in cxusb_i2c_xfer()

2013-11-29 Thread Alexey Khoroshilov
There are several failure paths in cxusb_i2c_xfer(), where d-i2c_mutex is left held. The patch fixes them. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/usb/dvb-usb/cxusb.c | 19 --- 1

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

2013-10-07 Thread Alexey Khoroshilov
project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- 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
()) are 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] [media] dvb_demux: fix deadlock in dmx_section_feed_release_filter()

2013-08-17 Thread Alexey Khoroshilov
Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- 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 index

[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 khoroshi...@ispras.ru --- drivers/media/usb/gspca/gspca.c | 6 +- 1

[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 khoroshi...@ispras.ru --- drivers

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

2013-07-03 Thread Alexey Khoroshilov
and 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 khoroshi...@ispras.ru --- drivers/media/usb/hdpvr/hdpvr-core.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions

[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 khoroshi...@ispras.ru --- drivers/media/usb/tlg2300

[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 khoroshi...@ispras.ru

[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 khoroshi...@ispras.ru --- drivers/staging/media/go7007/go7007-usb.c | 4

[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 khoroshi...@ispras.ru --- drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c | 2 ++ 1

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

2013-06-10 Thread Alexey Khoroshilov
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 khoroshi...@ispras.ru

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

2013-06-02 Thread Alexey Khoroshilov
-by: Alexey Khoroshilov khoroshi...@ispras.ru --- 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

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

2013-05-07 Thread Alexey Khoroshilov
by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- 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

[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 Khoroshilov

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 khoroshi...@ispras.ru 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 curiosity, what happens when

[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 khoroshi...@ispras.ru --- drivers/media/dvb-frontends/stv090x.c | 22

[PATCH] [media] ddbridge: fix error handling in module_init_ddbridge()

2012-08-16 Thread Alexey Khoroshilov
If pci_register_driver() failed, resources allocated in ddb_class_create() are leaked. The patch fixes it as well as it replaces -1 with correct error code in ddb_class_create(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi

[PATCH] [media] ddbridge: fix error handling in module_init_ddbridge()

2012-08-15 Thread Alexey Khoroshilov
If pci_register_driver() failed, resources allocated in ddb_class_create() are leaked. The patch fixes it. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/dvb/ddbridge/ddbridge-core.c |6 +- 1 file

[PATCH] drxk: Does not unlock mutex if sanity check failed in scu_command()

2012-04-05 Thread Alexey Khoroshilov
If sanity check fails in scu_command(), goto error leads to unlock of an unheld mutex. The check should not fail in reality, but it nevertheless worth fixing. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media

Re: [PATCH] [media] dib0700: unlock mutexes on error paths

2012-03-19 Thread Alexey Khoroshilov
On Mon, 19 Mar 2012 14:47:54 -0300, Mauro Carvalho Chehab mche...@redhat.com wrote: Em 07-03-2012 16:21, Alexey Khoroshilov escreveu: dib0700_i2c_xfer [_new and _legacy] leave i2c_mutex locked on error paths. The patch adds appropriate unlocks. Found by Linux Driver Verification project

[PATCH] [media] dib9000: get rid of Dib*Lock macros

2012-03-19 Thread Alexey Khoroshilov
The patch replaces Dib*Lock macros with direct calls to mutex functions as soon as they just make the driver code harder to review (per request of Mauro). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/dvb/frontends/dib9000.c | 128 +++-- 1

[PATCH] [media] dib0700: unlock mutexes on error paths

2012-03-07 Thread Alexey Khoroshilov
dib0700_i2c_xfer [_new and _legacy] leave i2c_mutex locked on error paths. The patch adds appropriate unlocks. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/dvb/dvb-usb/dib0700_core.c |9 ++--- 1

[PATCH 1/2] [media] dib9000: fix explicit lock mismatches

2012-03-06 Thread Alexey Khoroshilov
There are several error paths, where state-platform.risc.mem_mbx_lock is not unlocked. The patch fixes it. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/dvb/frontends/dib9000.c |6 +- 1 files

[PATCH 2/2] [media] dib9000: implement error handling for DibAcquireLock

2012-03-06 Thread Alexey Khoroshilov
DibAcquireLock() is implemented as mutex_lock_interruptible() but the driver does not handle unsuccessful locking. As a result it may lead to unlock of an unheld mutex. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru

[PATCH] staging: go7007: fix mismatch in mutex lock-unlock in [read|write]_reg_fp

2012-02-13 Thread Alexey Khoroshilov
-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/staging/media/go7007/s2250-board.c | 16 ++-- 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/go7007/s2250-board.c b/drivers/staging/media/go7007/s2250-board.c index e7736a9..014d384 100644

[PATCH] [media] hdpvr: fix null pointer dereference on error path in hdpvr_probe()

2011-09-16 Thread Alexey Khoroshilov
possible fail. Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/video/hdpvr/hdpvr-core.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c index 441dacf..fe0a088

[PATCH] V4L/DVB: radio-si470x: fix memory leak in si470x_usb_driver_probe()

2011-05-31 Thread Alexey Khoroshilov
radio-int_in_urb is not deallocated on error paths in si470x_usb_driver_probe(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/radio/si470x/radio-si470x-usb.c |4 +++- 1 files changed, 3 insertions

[PATCH] [media] lmedm04: Do not unlock mutex if mutex_lock_interruptible failed

2011-04-15 Thread Alexey Khoroshilov
There are a couple of places where mutex_unlock() is called even if mutex_lock_interruptible() failed. The patch fixes the issue. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/dvb/dvb-usb/lmedm04.c