Re: [lvc-project] [PATCH] tracing: remove unreachable trace_array_put

2024-07-16 Thread Alexey Khoroshilov
On 15.07.2024 16:47, Nikita Kiryushin wrote: > As nonseekable_open() documentation states: > "The function is not supposed to ever fail, the only > reason it returns an 'int' and not 'void' is so that it can be plugged > directly into file_operations structure." > > So it seems, that it will not f

[PATCH] net: mv643xx_eth: disable clk on error path in mv643xx_eth_shared_probe()

2019-02-15 Thread Alexey Khoroshilov
If mv643xx_eth_shared_of_probe() fails, mv643xx_eth_shared_probe() leaves clk undisabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/ethernet/marvell/mv643xx_eth.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion

[PATCH] net: stmmac: dwmac-rk: fix error handling in rk_gmac_powerup()

2019-01-26 Thread Alexey Khoroshilov
If phy_power_on() fails in rk_gmac_powerup(), clocks are left enabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

[PATCH v2] usb: dwc3: exynos: Fix error handling of clk_prepare_enable

2019-01-21 Thread Alexey Khoroshilov
If clk_prepare_enable() fails in dwc3_exynos_probe() or in dwc3_exynos_resume(), exynos->clks[0] is left undisabled because of usage preincrement in while condition. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Fixes: 9f2168367a0a ("u

[PATCH] usb: dwc3: exynos: Fix error handling of clk_prepare_enable

2019-01-18 Thread Alexey Khoroshilov
If clk_prepare_enable() fails in dwc3_exynos_probe(), exynos->clks[0] is left undisabled because of usage preincrement in while condition. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Fixes: 9f2168367a0a ("usb: dwc3: exynos: Rewo

[PATCH v2 1/2] media: tw9910: fix failure handling in tw9910_power_on()

2018-12-30 Thread Alexey Khoroshilov
If gpiod_get_optional() fails in tw9910_power_on(), clk is left undisabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- v2: reset pdn_gpio as well as Jacopo Mondi suggested. drivers/media/i2c/tw9910.c | 5 + 1 file changed, 5

[PATCH v2 2/2] media: tw9910: add helper function for setting gpiod value

2018-12-30 Thread Alexey Khoroshilov
tw9910 driver tries to sleep for the smae period of time after each gpiod_set_value(). The patch moves duplicated code to a helper function. Signed-off-by: Alexey Khoroshilov --- drivers/media/i2c/tw9910.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions

Re: [PATCH] media: tw9910: add missed clk_disable_unprepare() on failure path

2018-12-30 Thread Alexey Khoroshilov
Hi Jacopo, On 30.12.2018 12:49, Jacopo Mondi wrote: > On Sun, Dec 30, 2018 at 12:35:20AM +0300, Alexey Khoroshilov wrote: >> If gpiod_get_optional() fails in tw9910_power_on(), clk is left undisabled. > > Correct, thanks for spotting this. > > I think pdn_gpio shou

[PATCH] media: tw9910: add missed clk_disable_unprepare() on failure path

2018-12-29 Thread Alexey Khoroshilov
If gpiod_get_optional() fails in tw9910_power_on(), clk is left undisabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/i2c/tw9910.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/i2c/tw9910.c b/drivers

net: hns: question regarding ae_node device node refcounting

2018-12-22 Thread Alexey Khoroshilov
probe() or in hns_nic_dev_remove()? Or may be it is managed by fwnode somehow? -- Alexey Khoroshilov Linux Verification Center, ISPRAS web: http://linuxtesting.org

Re: [PATCH] mailbox: imx: Fix clk handling in imx_mu_probe()

2018-12-16 Thread Alexey Khoroshilov
) { unsigned long flags; if (clk == NULL || IS_ERR(clk)) return -EINVAL; So, I am not sure the NULL resistance is a part of the clk_enable() contract? -- Alexey On 17.12.2018 9:01, Oleksij Rempel wrote: > Hi Alexey, > > On Sun, Dec 16, 2018 at 02:01:44AM +0300, Alexey Kh

[PATCH] mailbox: imx: Fix clk handling in imx_mu_probe()

2018-12-15 Thread Alexey Khoroshilov
ion project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/mailbox/imx-mailbox.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 363d35d5e49d..ddde398f576e 100644 --- a/driv

[PATCH] soc: qcom: gsbi: Fix error handling in gsbi_probe()

2018-12-07 Thread Alexey Khoroshilov
If of_platform_populate() fails in gsbi_probe(), gsbi->hclk is left undisabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/soc/qcom/qcom_gsbi.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/driv

[PATCH] video: clps711x-fb: release disp device node in probe()

2018-11-02 Thread Alexey Khoroshilov
clps711x_fb_probe() increments refcnt of disp device node by of_parse_phandle() and leaves it undecremented on both successful and error paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/video/fbdev/clps711x-fb.c | 5 - 1

[PATCH] mfd: ti_am335x_tscadc: release device nodes in ti_tscadc_probe()

2018-10-26 Thread Alexey Khoroshilov
ti_tscadc_probe() increments refcnt of tsc and adc device nodes and leaves it undecremented. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/mfd/ti_am335x_tscadc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mfd

mfd: syscon: syscon_node_to_regmap() and device_node refcounting

2018-10-13 Thread Alexey Khoroshilov
Hello, Could you please clarify why it is safe to store device_node pointer in of_syscon_register()? Who is responsible to make sure that it is not disappear? static struct syscon *of_syscon_register(struct device_node *np) { ... syscon->np = np; } -- Thank you, Alexey Khoroshi

[PATCH] watchdog: ts4800: release syscon device node in ts4800_wdt_probe()

2018-10-13 Thread Alexey Khoroshilov
Put syscon device node when it is not needed anymore. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/watchdog/ts4800_wdt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/watchdog/ts4800_wdt.c b/drivers/watchdog

[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] iio: adc: imx25-gcq: Fix leak of device_node in mx25_gcq_setup_cfgs()

2018-09-21 Thread Alexey Khoroshilov
Leaving for_each_child_of_node loop we should release child device node, if it is not stored for future use. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/iio/adc/fsl-imx25-gcq.c | 6 ++ 1 file changed, 6 insertions(+) diff

[PATCH] spi: pic32-sqi: remove unnecessary of_node_get()

2018-09-14 Thread Alexey Khoroshilov
off-by: Alexey Khoroshilov --- drivers/spi/spi-pic32-sqi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-pic32-sqi.c b/drivers/spi/spi-pic32-sqi.c index bd1c6b53283f..62e6bf1f50b1 100644 --- a/drivers/spi/spi-pic32-sqi.c +++ b/drivers/spi/spi-pic32-sqi.c @@ -65

[PATCH] spi: pic32: remove unnecessary of_node_get()

2018-09-06 Thread Alexey Khoroshilov
off-by: Alexey Khoroshilov --- drivers/spi/spi-pic32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c index f8a45af1fa9f..46ff76193ee1 100644 --- a/drivers/spi/spi-pic32.c +++ b/drivers/spi/spi-pic32.c @@ -774,7 +774,7 @@ sta

[PATCH] gpio: dwapb: Fix error handling in dwapb_gpio_probe()

2018-08-28 Thread Alexey Khoroshilov
If dwapb_gpio_add_port() fails in dwapb_gpio_probe(), gpio->clk is left undisabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/gpio/gpio-dwapb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-dwapb.

[PATCH] clk: cdce925: release child device nodes

2018-08-21 Thread Alexey Khoroshilov
of_get_child_by_name() returns device node with refcount incremented, but there is no decrement in cdce925_probe(). The patch adds one. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/clk/clk-cdce925.c | 1 + 1 file changed, 1

[PATCH] rtc: isl1208: fix error handling in isl1208_probe()

2018-08-08 Thread Alexey Khoroshilov
After moving rtc_register_device() sysfs group is left unremoved on the error path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Fixes: 236b7187034e ("rtc: isl1208: switch to rtc_register_device") --- drivers/rtc/rtc-isl1208.c | 7

[PATCH] ASoC: tegra_alc5632: fix device_node refcounting

2018-07-27 Thread Alexey Khoroshilov
(linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- sound/soc/tegra/tegra_alc5632.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c index 5197d6b18cb6..98d87801d57a 100644 --- a/sound/soc/tegra

regulator: bcm590xx: of_node_put(np) missing

2018-07-21 Thread Alexey Khoroshilov
Hello, bcm590xx_parse_dt_reg_data() calls of_node_get(np), but there is nowhere of_node_put(np) in the driver. Should we add of_node_put(np) and what is timeframe of_node_get(np) required for? Found by Linux Driver Verification project (linuxtesting.org). -- Alexey Khoroshilov Linux

Re: [PATCH] Input: pxrc - fix leak of usb_device

2018-07-15 Thread Alexey Khoroshilov
Dear Marcus, On 15.07.2018 10:42, Marcus Folkesson wrote: > On Sat, Jul 14, 2018 at 08:51:09AM +, Dmitry Torokhov wrote: >> On Sat, Jul 14, 2018 at 10:09:20AM +0200, Marcus Folkesson wrote: >>> Hi Alexey, >>> >>> Good catch! >>> >>> On Fri

[PATCH] Input: pxrc - fix leak of usb_device

2018-07-13 Thread Alexey Khoroshilov
pxrc_probe() calls usb_get_dev(), but there is no usb_put_dev() anywhere in the driver. The patch adds one to error handling code and to pxrc_disconnect(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/input/joystick/pxrc.c | 2

[PATCH] sample: vfio-mdev: avoid deadlock in mdev_access()

2018-07-06 Thread Alexey Khoroshilov
mdev_access() calls mbochs_get_page() with mdev_state->ops_lock held, while mbochs_get_page() locks the mutex by itself. It leads to unavoidable deadlock. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- samples/vfio-mdev/mbochs.c | 4 +++-

[PATCH] ASoC: tegra: fix device_node refcounting

2018-06-15 Thread Alexey Khoroshilov
tegra_rt5677_probe() gets a couple of device nodes with of_parse_phandle(), but there is no release of them. The patch adds the release to tegra_rt5677_remove() and to error handling paths in the probe. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey

[PATCH] ASoC: rockchip: put device_node on remove

2018-06-09 Thread Alexey Khoroshilov
snd_rk_mc_probe() gets a couple of device nodes with of_parse_phandle(), but there is no release of them. The patch adds remove handler and proper error handling in the probe. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- sound/soc

[PATCH] power: reset: zx-reboot: put device node in zx_reboot_probe()

2018-06-02 Thread Alexey Khoroshilov
zx_reboot_probe() increments refcnt of zx296702-pcu device node by of_find_compatible_node() and leaves it undecremented on both successful and error paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/power/reset/zx-reboot.c | 1

[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 --- drivers/media/i2c/tc358743.c | 5

[PATCH] aic94xx: don't return zero on failure paths in aic94xx_init()

2018-05-18 Thread Alexey Khoroshilov
-by: Alexey Khoroshilov --- drivers/scsi/aic94xx/aic94xx_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c index 6c838865ac5a..4a4746cc6745 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b

[PATCH v3] mtd: nxp-spifi: release flash_np in nxp_spifi_probe()

2018-05-09 Thread Alexey Khoroshilov
nxp_spifi_probe() increments refcnt of SPI flash device node by of_get_next_available_child() and leaves it undecremented on both successful and error paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- v3: Move of_node_put() before return

[PATCH v2] mtd: nxp-spifi: release flash_np in nxp_spifi_probe()

2018-05-09 Thread Alexey Khoroshilov
nxp_spifi_probe() increments refcnt of SPI flash device node by of_get_next_available_child() and leaves it undecremented on both successful and error paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/mtd/spi-nor/nxp-spifi.c | 6

Re: [PATCH] mtd: nxp-spifi: decrement flash_np refcnt on error paths

2018-05-09 Thread Alexey Khoroshilov
On 09.05.2018 12:42, Boris Brezillon wrote: > On Tue, 8 May 2018 23:47:36 +0300 > Alexey Khoroshilov wrote: > >> nxp_spifi_probe() increments refcnt of SPI flash device node by >> of_get_next_available_child() and then it passes the node >> to mtd device in nxp_spifi

[PATCH] mtd: nxp-spifi: decrement flash_np refcnt on error paths

2018-05-08 Thread Alexey Khoroshilov
project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/mtd/spi-nor/nxp-spifi.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/spi-nor/nxp-spifi.c b/drivers/mtd/spi-nor/nxp-spifi.c index 15374216d4d9..8919e31f2ab8 100644 --- a

Re: [PATCH] power: supply: ltc2941-battery-gauge: Release device_node in ltc294x_i2c_probe()

2018-05-08 Thread Alexey Khoroshilov
Hi, On 01.05.2018 15:39, Sebastian Reichel wrote: > Hi, > > On Sun, Apr 29, 2018 at 01:35:55AM +0300, Alexey Khoroshilov wrote: >> There is of_node_get(client->dev.of_node) in ltc294x_i2c_probe(), >> but these is no of_node_put() somethere in the driver. >> >

[PATCH v2] spi: meson-spicc: Fix error handling in meson_spicc_probe()

2018-04-28 Thread Alexey Khoroshilov
If devm_spi_register_master() fails in meson_spicc_probe(), spicc->core is left undisabled. The patch fixes that. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Reviewed-by: Neil Armstrong --- v2: Fix subject as Neil Armstrong noted. driv

[PATCH] power: supply: ltc2941-battery-gauge: Release device_node in ltc294x_i2c_probe()

2018-04-28 Thread Alexey Khoroshilov
There is of_node_get(client->dev.of_node) in ltc294x_i2c_probe(), but these is no of_node_put() somethere in the driver. The patch adds one on error and normal paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/power/sup

[PATCH] iio: adc: ad799x: Fix error handling in ad799x_probe()

2018-04-20 Thread Alexey Khoroshilov
In case of errors in write/read config, st->vref is left undisabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Fixes: 0f7ddcc1bff1 ("iio:adc:ad799x: Write default config on probe and reset alert status on probe") --- dr

[PATCH] spi: meson-axg: Fix error handling in meson_spicc_probe()

2018-04-13 Thread Alexey Khoroshilov
If devm_spi_register_master() fails in meson_spicc_probe(), spicc->core is left undisabled. The patch fixes that. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/spi/spi-meson-spicc.c | 11 --- 1 file changed, 8 inserti

[PATCH] spi: stm32: Fix error handling in stm32_spi_probe()

2018-03-30 Thread Alexey Khoroshilov
clk_get_rate() is below clk_prepare_enable(), so its error should lead to goto err_clk_disable, not to err_master_put. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/spi/spi-stm32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] watchdog: davinci_wdt: fix error handling in davinci_wdt_probe()

2018-03-23 Thread Alexey Khoroshilov
clk_disable_unprepare() was added to one error path, but there is another one. The patch makes sure clk is disabled at the both of them. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/watchdog/davinci_wdt.c | 15 +++ 1

[PATCH v2] spi: jcore: disable ref_clk after getting its rate

2018-03-17 Thread Alexey Khoroshilov
Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- v2: There is no reason to wait for remove to disable ref_clk. drivers/spi/spi-jcore.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-jcore.c b/drivers/spi/spi-jcore.c index

[PATCH] spi: jcore: disable clock on remove

2018-03-16 Thread Alexey Khoroshilov
The driver does not disable ref_clk on remove. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/spi/spi-jcore.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-jcore.c b

[PATCH] watchdog: sprd_wdt: Fix error handling in sprd_wdt_enable()

2018-03-08 Thread Alexey Khoroshilov
If clk_prepare_enable(wdt->rtc_enable) fails, wdt->enable clock is left enabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/watchdog/sprd_wdt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/d

[PATCH] serial: mxs-auart: disable clks of Alphascale ASM9260

2018-03-02 Thread Alexey Khoroshilov
In case of Alphascale ASM9260 probe() enables s->clk and s->clk_ahb via mxs_get_clks(), but there is no disable of the clocks. The patch adds it to error paths and to mxs_auart_remove(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov

[PATCH] phy: lpc18xx-usb-otg: error handling in lpc18xx_usb_otg_phy_power_on()

2018-02-22 Thread Alexey Khoroshilov
If regmap_update_bits() fails in lpc18xx_usb_otg_phy_power_on(), lpc->clk is left enabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/phy/phy-lpc18xx-usb-otg.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) d

[PATCH] tun: fix mismatch in mutex lock-unlock in tun_get_user()

2018-02-16 Thread Alexey Khoroshilov
There is a single error path where tfile->napi_mutex is left unlocked. It can lead to a deadlock. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/tun.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/net/tun.

[PATCH v2] watchdog: asm9260_wdt: fix error handling in asm9260_wdt_probe()

2018-02-10 Thread Alexey Khoroshilov
If devm_reset_control_get_exclusive() fails, asm9260_wdt_probe() returns immediately. But clks has been already enabled at that point, so it is required to disable them or to move the code around. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov

[PATCH v4 3/3] mtd: nand: vf610: check mtd_device_register() return code

2018-02-09 Thread Alexey Khoroshilov
vf610_nfc_probe() misses error handling of mtd_device_register(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/mtd/nand/vf610_nfc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand

[PATCH v4 2/3] mtd: nand: vf610: improve readability of error label

2018-02-09 Thread Alexey Khoroshilov
Use clearer error labels as Boris Brezillon suggested. Signed-off-by: Alexey Khoroshilov --- drivers/mtd/nand/vf610_nfc.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c index c4568372c3e3

[PATCH v4 1/3] mtd: nand: vf610: remove the unnecessary of_node_put()

2018-02-09 Thread Alexey Khoroshilov
Calling of_node_put() in vf610_nfc_probe() is wrong because nothing in this code retains a reference to the DT node. Signed-off-by: Alexey Khoroshilov --- drivers/mtd/nand/vf610_nfc.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/nand

[PATCH v4 0/3] mtd: nand: vf610: fix error handling in vf610_nfc_probe()

2018-02-09 Thread Alexey Khoroshilov
patches. Alexey Khoroshilov (3): mtd: nand: vf610: remove the unnecessary of_node_put() mtd: nand: vf610: improve readability of error label mtd: nand: vf610: check mtd_device_register() return code drivers/mtd/nand/vf610_nfc.c | 29 - 1 file changed, 16 insertions

[PATCH] watchdog: asm9260_wdt: fix error handling in asm9260_wdt_probe()

2018-02-09 Thread Alexey Khoroshilov
If devm_reset_control_get_exclusive() fails, asm9260_wdt_probe() returns immediately. But clks has been already enabled at that point, so it is required to disable them. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/watchdog

[PATCH] rtc: gemini/ftrtc010: disable clk on error paths in ftrtc010_rtc_probe()

2018-02-02 Thread Alexey Khoroshilov
ftrtc010_rtc_probe() leaves clks enabled in case of errors. The patch adds proper disabling code. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/rtc/rtc-ftrtc010.c | 37 - 1 file changed, 28

[PATCH v3] mtd: nand: vf610: fix error handling in vf610_nfc_probe()

2018-01-26 Thread Alexey Khoroshilov
vf610_nfc_probe() misses error handling of mtd_device_register() and contains unneeded of_node_put() on error path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- v2: Add nand_cleanup() to undone nand_scan_tail() as Boris Brezillon noted. v3

[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 --- drivers/media/rc/ir-hix5hd2.c | 35 --- 1 file

[PATCH] crypto: picoxcell - Fix error handling in spacc_probe()

2018-01-19 Thread Alexey Khoroshilov
If clk_get() fails, device_remove_file() looks inappropriate. The error path, where all crypto_register fail, misses resource deallocations. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/crypto/picoxcell_crypto.c | 27

media: tc358743: clk_disable_unprepare(refclk) missed

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

[PATCH] thermal: int3400_thermal: fix error handling in int3400_thermal_probe()

2017-12-29 Thread Alexey Khoroshilov
There are resources that are not dealocated on failure path in int3400_thermal_probe(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/thermal/int340x_thermal/int3400_thermal.c | 10 +++--- 1 file changed, 7 insertions(+), 3

[PATCH v2] mtd: nand: vf610: fix error handling in vf610_nfc_probe()

2017-12-23 Thread Alexey Khoroshilov
vf610_nfc_probe() misses error handling of mtd_device_register(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- v2: Add nand_cleanup() to undone nand_scan_tail() as Boris Brezillon noted. drivers/mtd/nand/vf610_nfc.c | 25

[PATCH] mtd: nand: vf610: fix error handling in vf610_nfc_probe()

2017-12-22 Thread Alexey Khoroshilov
vf610_nfc_probe() misses error handling of mtd_device_register(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/mtd/nand/vf610_nfc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand

[PATCH] net: phy: xgene: disable clk on error paths

2017-12-15 Thread Alexey Khoroshilov
There are several error paths in xgene_mdio_probe(), where clk is left undisabled. The patch fixes them. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/phy/mdio-xgene.c | 21 +++-- 1 file changed, 15 insertions

[PATCH] i2c: hix5hd2: Make sure clk is disabled in remove

2017-12-07 Thread Alexey Khoroshilov
pm_runtime_set_suspended() does not lead to call of suspend callback, so clk may be left undisabled in hix5hd2_i2c_remove(). By the way, the patch adds error handling for clk_prepare_enable(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov

[PATCH] fpga: socfpga-a10: disable clk on error in socfpga_a10_fpga_probe()

2017-12-01 Thread Alexey Khoroshilov
If fpga_mgr_register() fails, a clock is left undisabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/fpga/socfpga-a10.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/fpga/socfpga-a10.c b

[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 --- drivers/media/i2c/mt9v032.c | 21

[PATCH] rtc: brcmstb-waketimer: fix error handling in brcmstb_waketmr_probe()

2017-11-17 Thread Alexey Khoroshilov
brcmstb_waketmr_probe() does not disable timer->clk on error paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/rtc/rtc-brcmstb-waketimer.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --gi

[PATCH] phy: rockchip-inno-usb2: fix error handling in rockchip_usb2phy_probe()

2017-11-10 Thread Alexey Khoroshilov
rockchip_usb2phy_probe() does not disable clock in case of failure in devm_of_phy_provider_register() and it ignores if clk_prepare_enable() fails. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c

[PATCH] phy: qcom-usb: Fix error handling in qcom_usb_hsic_phy_power_on()

2017-10-27 Thread Alexey Khoroshilov
There is a misprint in error handling of pinctrl_lookup_state(), where qcom_usb_hsic_phy_power_on() does return instead of goto err_ulpi. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/phy/qualcomm/phy-qcom-usb-hsic.c | 6 -- 1

[PATCH v2] w1: keep balance of mutex locks and refcnts

2017-10-21 Thread Alexey Khoroshilov
THERM_REFCNT. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- v2: Implement suggestions of Evgeniy Polyakov. Make use single exit point and not a mix of returns in the body of the function. Switch to nested locking: grab the reference earlier and then try

[PATCH] usb: phy: tahvo: fix error handling in tahvo_usb_probe()

2017-10-20 Thread Alexey Khoroshilov
If devm_extcon_dev_allocate() fails, we should disable clk before return. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Fixes: 860d2686fda7 ("usb: phy: tahvo: Use devm_extcon_dev_[allocate|register]() and replace deprecated API") --

[PATCH] mfd: mxs-lradc: fix error handling in mxs_lradc_probe()

2017-10-13 Thread Alexey Khoroshilov
There is the only path, where mxs_lradc_probe() leaves clk undisabled, since it does return instead of goto err_clk. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/mfd/mxs-lradc.c | 6 -- 1 file changed, 4 insertions(+), 2

Re: [PATCH] w1: keep balance of mutex locks and refcnts

2017-10-07 Thread Alexey Khoroshilov
ndling without returns will be still quite messy. Is it possible to switch to a nested variant: mutex_lock-atomic_inc-atomic_dec-mutex_unlock or atomic_inc-mutex_lock-mutex_unlock-atomic_dec ? -- Alexey On 01.10.2017 08:55, Evgeniy Polyakov wrote: > Hi Alex > > 29.09.2017, 23:

[PATCH] rpmsg: glink: keep balance of mutex locks in qcom_glink_request_intent()

2017-10-06 Thread Alexey Khoroshilov
If qcom_glink_tx() fails in qcom_glink_request_intent(), it returns immediately leaving intent_req_lock mutex locked. So the next tries to send intent request lead to deadlock. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/rpmsg

[PATCH] w1: keep balance of mutex locks and refcnts

2017-09-29 Thread Alexey Khoroshilov
THERM_REFCNT. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/w1/slaves/w1_therm.c | 37 - 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves

[PATCH] clk: si5351: implement remove handler

2017-09-15 Thread Alexey Khoroshilov
The driver has no remove function, so it does not cleanup resources that are not under devm management. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/clk/clk-si5351.c | 13 + 1 file changed, 13 insertions(+) diff --git

[PATCH] mtd: oxnas_nand: Fix error handling in oxnas_nand_probe()

2017-09-08 Thread Alexey Khoroshilov
oxnas_nand_probe() does not disable clock on error paths. The patch adds disabling using devm interface. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/mtd/nand/oxnas_nand.c | 22 +++--- 1 file changed, 15 insertions

[PATCH] serial: sccnxp: Fix error handling in sccnxp_probe()

2017-09-02 Thread Alexey Khoroshilov
sccnxp_probe() returns result of regulator_disable() that may lead to returning zero, while device is not properly initialized. Also the driver enables clocks, but it does not disable it. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov

Re: [PATCH] usb: gadget: pch_udc: add checks for dma mapping errors

2017-09-02 Thread Alexey Khoroshilov
On 24.08.2017 04:02, Jack Pham wrote: > On Thu, Aug 24, 2017 at 01:47:08AM +0300, Alexey Khoroshilov wrote: >> There are no checks for dma mapping errors in pch_udc. >> Tha patch adds the checks and error handling code. >> Compile tested only. >> >> Found by

[PATCH] usb: gadget: pch_udc: add checks for dma mapping errors

2017-08-23 Thread Alexey Khoroshilov
There are no checks for dma mapping errors in pch_udc. Tha patch adds the checks and error handling code. Compile tested only. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/usb/gadget/udc/pch_udc.c | 15 +-- 1 file

Re: Inconsistency in usb_add_gadget_udc_release() interface

2017-08-16 Thread Alexey Khoroshilov
On 16.08.2017 18:24, Alan Stern wrote: > On Wed, 16 Aug 2017, Alexey Khoroshilov wrote: > >> Hello, >> >> usb_add_gadget_udc_release() gets release() argument that allows to >> release user resources. >> >> As far as I can see, the

Inconsistency in usb_add_gadget_udc_release() interface

2017-08-15 Thread Alexey Khoroshilov
n error paths? -- Alexey Khoroshilov Linux Verification Center, ISPRAS web: http://linuxtesting.org

[PATCH v3 net-next 2/2] wan: dscc4: convert to plain DMA API

2017-08-10 Thread Alexey Khoroshilov
Make use the dma_*() interfaces rather than the pci_*() interfaces. Signed-off-by: Alexey Khoroshilov --- drivers/net/wan/dscc4.c | 96 ++--- 1 file changed, 51 insertions(+), 45 deletions(-) diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan

[PATCH v3 net-next 1/2] wan: dscc4: add checks for dma mapping errors

2017-08-10 Thread Alexey Khoroshilov
The driver does not check if mapping dma memory succeed. The patch adds the checks and failure handling. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- v2: Fix issues noted by David Miller and Francois Romieu. v3: Improve code per Francois

[PATCH net-next v2] wan: dscc4: add checks for dma mapping errors

2017-08-08 Thread Alexey Khoroshilov
The driver does not check if mapping dma memory succeed. The patch adds the checks and failure handling. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- v2: Fix issues noted by David Miller and Francois Romieu. drivers/net/wan/dscc4.c | 52

[PATCH] wan: dscc4: add checks for dma mapping errors

2017-08-04 Thread Alexey Khoroshilov
The driver does not check if mapping dma memory succeed. The patch adds the checks and failure handling. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/wan/dscc4.c | 52 +++-- 1 file

[PATCH] drivers/serial: Do not leave sysfs group in case of error in aspeed_vuart_probe()

2017-07-28 Thread Alexey Khoroshilov
There are several error handling paths in aspeed_vuart_probe(), where sysfs group is left unremoved. The patch fixes them. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/tty/serial/8250/8250_aspeed_vuart.c | 7 +-- 1 file

[PATCH] platform/x86: wmi: Fix error handling in acpi_wmi_init()

2017-07-21 Thread Alexey Khoroshilov
The order of resource deallocations is messed up in acpi_wmi_init(). It should be vice versa. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/platform/x86/wmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH v3] serial: 8250: fix error handling in of_platform_serial_probe()

2017-07-19 Thread Alexey Khoroshilov
clk_disable_unprepare(info->clk) is missed in of_platform_serial_probe(), while irq_dispose_mapping(port->irq) is missed in of_platform_serial_setup(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- v2: Rebase on top of e2860e1f62f2 &

[PATCH v2] serial: 8250: fix error handling in of_platform_serial_probe()

2017-07-18 Thread Alexey Khoroshilov
clk_disable_unprepare(info->clk) is missed in of_platform_serial_probe(), while irq_dispose_mapping(port->irq) is missed in of_platform_serial_setup(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- v2: Rebase on top of e2860e1f62f2 &

Re: [PATCH] serial: 8250: fix error handling in of_platform_serial_probe()

2017-07-18 Thread Alexey Khoroshilov
On 18.07.2017 10:27, Greg Kroah-Hartman wrote: > On Sat, Jul 01, 2017 at 01:49:29AM +0300, Alexey Khoroshilov wrote: >> clk_disable_unprepare(info->clk) is missed in of_platform_serial_probe(), >> while irq_dispose_mapping(port->irq) is missed in of_platform_serial_setup().

[PATCH] smsc911x: Add check for ioremap_nocache() return code

2017-07-12 Thread Alexey Khoroshilov
There is no check for return code of smsc911x_drv_probe() in smsc911x_drv_probe(). The patch adds one. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/ethernet/smsc/smsc911x.c | 5 + 1 file changed, 5 insertions(+) diff

[PATCH] serial: 8250: fix error handling in of_platform_serial_probe()

2017-06-30 Thread Alexey Khoroshilov
clk_disable_unprepare(info->clk) is missed in of_platform_serial_probe(), while irq_dispose_mapping(port->irq) is missed in of_platform_serial_setup(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/tty/serial/8250/8250_of.

[PATCH] vmlfb: Fix error handling in cr_pll_init()

2017-06-22 Thread Alexey Khoroshilov
There is an error path, where iomemory is left mapped. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/video/fbdev/vermilion/cr_pll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/fbdev/vermilion/cr_pll.c b

[PATCH] goldfish_pipe: allocate memory with GFP_ATOMIC in spinlock context

2017-06-09 Thread Alexey Khoroshilov
get_free_pipe_id_locked() is called with spinlock held, so the patch replaces GFP_KERNEL with GFP_ATOMIC to avoid sleeping in atomic spinlock context. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/platform/goldfish/goldfish_pipe.c

[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

[PATCH] net: atheros: atl2: don't return zero on failure path in atl2_probe()

2017-05-19 Thread Alexey Khoroshilov
If dma mask checks fail in atl2_probe(), it breaks off initialization, deallocates all resources, but returns zero. The patch adds proper error code return value and make error code setup unified. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov

  1   2   3   4   5   >