[PATCH] clk: bcm2835: add missing release if devm_clk_hw_register fails

2020-08-09 Thread Navid Emamdoost
In the implementation of bcm2835_register_pll(), the allocated pll is leaked if devm_clk_hw_register() fails to register hw. Release pll if devm_clk_hw_register() fails. Signed-off-by: Navid Emamdoost --- drivers/clk/bcm/clk-bcm2835.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH] scsi: qla2xxx: fix memory leak if qlt_add_target fails

2020-08-09 Thread Navid Emamdoost
In the implementation of qla2x00_probe_one() the allocated and initialized ha is leaked if it fails to add target via qlt_add_target(). Go to error handling path if qlt_add_target() fails. Signed-off-by: Navid Emamdoost --- drivers/scsi/qla2xxx/qla_os.c | 4 +++- 1 file changed, 3 insertions

[PATCH v3] cxgb4: add missing release on skb in uld_send()

2020-07-22 Thread Navid Emamdoost
In the implementation of uld_send(), the skb is consumed on all execution paths except one. Release skb when returning NET_XMIT_DROP. Signed-off-by: Navid Emamdoost --- v3: - fixed the base problem, and used kfree_skb --- drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 + 1 file changed, 1

[PATCH v2] cxgb4: add missing release on skb in uld_send()

2020-07-22 Thread Navid Emamdoost
In the implementation of uld_send(), the skb is consumed on all execution paths except one. Release skb when returning NET_XMIT_DROP. Signed-off-by: Navid Emamdoost --- changes in v2: - using kfree_skb() based on David Miller suggestion. --- drivers/net/ethernet/chelsio/cxgb4/sge.c | 2

[PATCH] mt76: mt76u: add missing release on skb in __mt76x02u_mcu_send_msg

2020-07-17 Thread Navid Emamdoost
In the implementation of __mt76x02u_mcu_send_msg() the skb is consumed all execution paths except one. Release skb before returning if test_bit() fails. Signed-off-by: Navid Emamdoost --- drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c | 7 +-- 1 file changed, 5 insertions(+), 2

[PATCH] nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frame

2020-07-17 Thread Navid Emamdoost
The implementation of s3fwrn5_recv_frame() is supposed to consume skb on all execution paths. Release skb before returning -ENODEV. Signed-off-by: Navid Emamdoost --- drivers/nfc/s3fwrn5/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nfc/s3fwrn5/core.c b/drivers/nfc/s3fwrn5

[PATCH] mt7601u: add missing release on skb in mt7601u_mcu_msg_send

2020-07-17 Thread Navid Emamdoost
In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be consumed on all execution paths. Release skb before returning if test_bit() fails. Signed-off-by: Navid Emamdoost --- drivers/net/wireless/mediatek/mt7601u/mcu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH] cxgb4: add missing release on skb in uld_send()

2020-07-17 Thread Navid Emamdoost
In the implementation of uld_send(), the skb is consumed on all execution paths except one. Release skb when returning NET_XMIT_DROP. Signed-off-by: Navid Emamdoost --- drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/chelsio

Re: [PATCH] ALSA: trident: Fix a memory leak in snd_trident_create

2020-07-11 Thread Navid Emamdoost
On Sat, Jul 11, 2020 at 4:04 AM Takashi Iwai wrote: > > On Sat, 11 Jul 2020 09:08:30 +0200, > Navid Emamdoost wrote: > > > > In the implementation of snd_trident_create(), the allocated trident is > > leaked if snd_trident_mixer() fails. Release via snd_trident_free(

[PATCH] ALSA: trident: Fix a memory leak in snd_trident_create

2020-07-11 Thread Navid Emamdoost
In the implementation of snd_trident_create(), the allocated trident is leaked if snd_trident_mixer() fails. Release via snd_trident_free(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Navid Emamdoost --- sound/pci/trident/trident_main.c | 5 - 1 file changed, 4 insert

Re: [PATCH] dmaengine: stm32-dmamux: fix pm_runtime_get_sync fialure cases

2020-06-24 Thread Navid Emamdoost
On Wed, Jun 24, 2020 at 2:40 AM Vinod Koul wrote: > > On 03-06-20, 14:36, Navid Emamdoost wrote: > > s/fialure/failure > > > Calling pm_runtime_get_sync increments the counter even in case of > > failure, causing incorrect ref count. Call pm_runtime_put_sync if &g

Re: [PATCH] engine: stm32-dma: call pm_runtime_put if pm_runtime_get_sync fails

2020-06-24 Thread Navid Emamdoost
Hi, On Wed, Jun 24, 2020 at 2:39 AM Vinod Koul wrote: > > On 03-06-20, 13:34, Navid Emamdoost wrote: > > Calling pm_runtime_get_sync increments the counter even in case of > > failure, causing incorrect ref count. Call pm_runtime_put if > > pm_runtime_get_sync fails. &g

Re: [PATCH v2] drm/etnaviv: fix ref count leak via pm_runtime_get_sync

2020-06-17 Thread Navid Emamdoost
Hi Lucas, On Wed, Jun 17, 2020 at 4:53 AM Lucas Stach wrote: > > Hi Navid, > > Am Montag, den 15.06.2020, 01:12 -0500 schrieb Navid Emamdoost: > > in etnaviv_gpu_submit, etnaviv_gpu_recover_hang, etnaviv_gpu_debugfs, > > and etnaviv_gpu_init the call to pm_runtime

Re: [PATCH] gpio: rcar: handle pm_runtime_get_sync failure case

2020-06-17 Thread Navid Emamdoost
Hi Geert, On Wed, Jun 17, 2020 at 2:26 AM Geert Uytterhoeven wrote: > > Hi Navid, > > On Fri, Jun 5, 2020 at 4:50 AM Navid Emamdoost > wrote: > > Calling pm_runtime_get_sync increments the counter even in case of > > failure, causing incorrect ref co

[PATCH v2] gpio: rcar: handle pm_runtime_get_sync failure case

2020-06-17 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- Changes in v2: - use pm_runtime_put_noidle --- drivers/gpio/gpio-rcar.c | 4 +++- 1 file changed

Re: [PATCH] Input: bma150: fix ref count leak in bma150_open

2020-06-14 Thread Navid Emamdoost
On Sun, Jun 14, 2020 at 4:27 AM Andy Shevchenko wrote: > > On Sun, Jun 14, 2020 at 8:58 AM Navid Emamdoost > wrote: > > > > in bma150_open, pm_runtime_get_sync is called which > > increments the counter even in case of failure, leading to incorrect > > ref cou

[PATCH v2] Input: bma150: fix ref count leak in bma150_open

2020-06-14 Thread Navid Emamdoost
in bma150_open, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- Changes in v2: -- repplace pm_runtime_put with

Re: [PATCH] drm/etnaviv: fix ref count leak via pm_runtime_get_sync

2020-06-14 Thread Navid Emamdoost
On Sun, Jun 14, 2020 at 4:48 AM Andy Shevchenko wrote: > > On Sun, Jun 14, 2020 at 9:48 AM Navid Emamdoost > wrote: > > ... > > > + if (ret < 0) { > > > + pm_runtime_put(gpu->dev); > > Please, in all your patc

[PATCH v2] drm/etnaviv: fix ref count leak via pm_runtime_get_sync

2020-06-14 Thread Navid Emamdoost
in etnaviv_gpu_submit, etnaviv_gpu_recover_hang, etnaviv_gpu_debugfs, and etnaviv_gpu_init the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost

Re: [PATCH] drm/exynos: fix ref count leak in mic_pre_enable

2020-06-14 Thread Navid Emamdoost
On Sun, Jun 14, 2020 at 7:47 PM Inki Dae wrote: > > Hi, > > 20. 6. 14. 오후 3:23에 Navid Emamdoost 이(가) 쓴 글: > > in mic_pre_enable, pm_runtime_get_sync is called which > > increments the counter even in case of failure, leading to incorrect > > ref count. In case of fa

[PATCH v2] drm/exynos: fix ref count leak in mic_pre_enable

2020-06-14 Thread Navid Emamdoost
in mic_pre_enable, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- Changes in v2: - reuse the unlock label and call

Re: [PATCH] drm/vc4: fix ref count leak in vc4_dsi_encoder_enable

2020-06-14 Thread Navid Emamdoost
On Sun, Jun 14, 2020 at 7:32 AM Andy Shevchenko wrote: > > On Sun, Jun 14, 2020 at 9:55 AM Navid Emamdoost > wrote: > > > > in vc4_dsi_encoder_enable, the call to pm_runtime_get_sync increments > > the counter even in case of failure, leading to incorrect > &

[PATCH] drm/amd/display: fix ref count leak in amdgpu_drm_ioctl

2020-06-14 Thread Navid Emamdoost
in amdgpu_drm_ioctl the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- 1 file changed, 2

[PATCH] drm/amdgpu: fix ref count leak in amdgpu_driver_open_kms

2020-06-14 Thread Navid Emamdoost
in amdgpu_driver_open_kms the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 ++- 1 file

[PATCH] drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config

2020-06-14 Thread Navid Emamdoost
in amdgpu_display_crtc_set_config, the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 5

[PATCH] drm/amdgpu/display: fix ref count leak when pm_runtime_get_sync fails

2020-06-14 Thread Navid Emamdoost
The call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 16 1 file changed

[PATCH] drm/vc4: fix ref count leak in vc4_vec_encoder_enable

2020-06-14 Thread Navid Emamdoost
in vc4_vec_encoder_enable, the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/vc4/vc4_vec.c | 8 +--- 1 file changed

[PATCH] drm/vc4: fix ref count leak in vc4_v3d_pm_get

2020-06-13 Thread Navid Emamdoost
in vc4_v3d_pm_get, the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/vc4/vc4_v3d.c | 1 + 1 file changed, 1 insertion

[PATCH] drm/vc4: fix ref count leak in vc4_dsi_encoder_enable

2020-06-13 Thread Navid Emamdoost
in vc4_dsi_encoder_enable, the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/vc4/vc4_dsi.c | 10 ++ 1 file

[PATCH] drm/etnaviv: fix ref count leak via pm_runtime_get_sync

2020-06-13 Thread Navid Emamdoost
in etnaviv_gpu_submit, etnaviv_gpu_recover_hang, etnaviv_gpu_debugfs, and etnaviv_gpu_init the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost

[PATCH] drm/panfrost: perfcnt: fix ref count leak in panfrost_perfcnt_enable_locked

2020-06-13 Thread Navid Emamdoost
in panfrost_perfcnt_enable_locked, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/panfrost/panfrost_perfcnt.c

[PATCH] drm/panfrost: fix ref count leak in panfrost_job_hw_submit

2020-06-13 Thread Navid Emamdoost
in panfrost_job_hw_submit, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/panfrost/panfrost_job.c | 8 +--- 1

[PATCH] drm/exynos: fix ref count leak in mic_pre_enable

2020-06-13 Thread Navid Emamdoost
in mic_pre_enable, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/exynos/exynos_drm_mic.c | 2 +- 1 file changed

[PATCH] Input: stmfts: fix ref count leak in stmfts_input_open

2020-06-13 Thread Navid Emamdoost
in stmfts_input_open, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/input/touchscreen/stmfts.c | 7 +-- 1 file

[PATCH] Input: bma150: fix ref count leak in bma150_open

2020-06-13 Thread Navid Emamdoost
in bma150_open, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/input/misc/bma150.c | 7 +-- 1 file changed, 5

[PATCH] Input: omap4-keypad: fix ref count leak if pm_runtime_get_sync fails

2020-06-13 Thread Navid Emamdoost
calling pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/input/keyboard/omap4-keypad.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions

[PATCH] net: macb: fix ref count leaking via pm_runtime_get_sync

2020-06-13 Thread Navid Emamdoost
in macb_mdio_write, macb_mdio_read, and at91ether_open, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost --- drivers/net/ethernet

[PATCH] net: fec: fix ref count leaking when pm_runtime_get_sync fails

2020-06-13 Thread Navid Emamdoost
in fec_enet_mdio_read, fec_enet_mdio_write, fec_enet_get_regs, fec_enet_open and fec_drv_remove, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid

Re: [PATCH] io: pressure: zpa2326: handle pm_runtime_get_sync failure

2020-06-07 Thread Navid Emamdoost
On Sat, Jun 6, 2020 at 2:29 PM Andy Shevchenko wrote: > > > > On Saturday, June 6, 2020, Jonathan Cameron wrote: >> >> On Thu, 4 Jun 2020 21:44:44 -0500 >> Navid Emamdoost wrote: >> >> > Calling pm_runtime_get_sync increments the counter even i

Re: [PATCH] spi: tegra114: missing put on pm_runtime_get_sync failure

2020-06-04 Thread Navid Emamdoost
On Fri, Jun 5, 2020 at 1:09 AM Jon Hunter wrote: > > > On 02/06/2020 05:55, Navid Emamdoost wrote: > > the call to pm_runtime_get_sync increments the counter even > > in case of failure leading to incorrect ref count. > > Call pm_runtime_put if pm_runtime_get_sync f

[PATCH] can: xilinx_can: handle failure cases of pm_runtime_get_sync

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/net/can/xilinx_can.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH] wlcore: mesh: handle failure case of pm_runtime_get_sync

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/net/wireless/ti/wlcore/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH] PCI: rcar: handle the failure case of pm_runtime_get_sync

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/pci/controller/pcie-rcar.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a

[PATCH] PCI: dwc: pci-dra7xx: handle failure case of pm_runtime_get_sync

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/pci/controller/dwc/pci-dra7xx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[PATCH] PCI: qcom: handle pm_runtime_get_sync failure case

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/pci/controller/dwc/pcie-qcom.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

[PATCH] PCI: tegra: handle failure case of pm_runtime_get_sync

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/pci/controller/pci-tegra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci

[PATCH] sata_rcar: handle pm_runtime_get_sync failure cases

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/ata/sata_rcar.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a

[PATCH] gpio: arizona: put pm_runtime in case of failure

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count if pm_runtime_put is not called in error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/gpio/gpio-arizona.c | 6 +- 1 file

[PATCH] gpio: arizona: handle pm_runtime_get_sync failure case

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/gpio/gpio-arizona.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio

[PATCH] gpio: rcar: handle pm_runtime_get_sync failure case

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/gpio/gpio-rcar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH] mfd: arizona: handle pm_runtime_get_sync failure case

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put_sync if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/mfd/arizona-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

[PATCH] io: pressure: zpa2326: handle pm_runtime_get_sync failure

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/iio/pressure/zpa2326.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

[PATCH] dmaengine: sprd: handle the failure cases of pm_runtime_get_sync

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/dma/sprd-dma.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a

[PATCH] dmaengine: rcar-dmac: handle pm_runtime_get_sync failure

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/dma/sh/rcar-dmac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/sh/rcar-dmac.c

[PATCH] dmaengine: sh: usb-dmac: handle pm_runtime_get_sync failure

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/dma/sh/usb-dmac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH] dmaengine: tegra210-adma: handle pm_runtime_get_sync failure cases

2020-06-04 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/dma/tegra210-adma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers

Re: [PATCH] dmaengine: tegra210-adma: fix pm_runtime_get_sync failure

2020-06-04 Thread Navid Emamdoost
On Thu, Jun 4, 2020 at 12:45 PM Jon Hunter wrote: > > > On 03/06/2020 19:41, Navid Emamdoost wrote: > > Calling pm_runtime_get_sync increments the counter even in case of > > failure, causing incorrect ref count. Call pm_runtime_put if > > pm_runtime_get_sync fails. &

[PATCH] dmaengine: stm32-dmamux: fix pm_runtime_get_sync fialure cases

2020-06-03 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put_sync if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/dma/stm32-dmamux.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a

Re: [PATCH] dmaengine: stm32-mdma: call pm_runtime_put if pm_runtime_get_sync fails

2020-06-03 Thread Navid Emamdoost
incremented by a call of >the function “pm_runtime_get_sync”. >Thus call the function “pm_runtime_put” also in two error cases >to keep the reference counting consistent. > > > Would you like to add the tag “Fixes” to the commit message? > > Regards, > Markus -- Navid.

[PATCH] dmaengine: tegra210-adma: fix pm_runtime_get_sync failure

2020-06-03 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/dma/tegra210-adma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/tegra210

[PATCH] dmaengine: tegra210-adma: fix pm_runtime_get_sync failure

2020-06-03 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/dma/tegra210-adma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

[PATCH] engine: stm32-dma: call pm_runtime_put if pm_runtime_get_sync fails

2020-06-03 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/dma/stm32-dma.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a

[PATCH] dmaengine: stm32-mdma: call pm_runtime_put if pm_runtime_get_sync fails

2020-06-03 Thread Navid Emamdoost
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/dma/stm32-mdma.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a

Re: spi: spi-ti-qspi: call pm_runtime_put on pm_runtime_get failure

2020-06-02 Thread Navid Emamdoost
t; opinions just makes things harder for submitters. Thanks Mark for your constructive opinion, In most cases, such stylistic comments become confusing and discouraging to those who are trying to chip in. Personally I think as long as the patch does not contain typo and is not ambiguous from the maintainer's perspective, it should be fine to let it go forward. -- Navid.

[PATCH] media: staging: tegra-vde: add missing pm_runtime_put_autosuspend

2020-06-01 Thread Navid Emamdoost
Call to pm_runtime_get_sync increments counter even in case of failure leading to incorrect ref count. Call pm_runtime_put_autosuspend if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/staging/media/tegra-vde/vde.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH] spi: img-spfi: add missing pm_runtime_pu

2020-06-01 Thread Navid Emamdoost
Call to pm_runtime_get_sync increments counter even in case of failure leading to incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/spi/spi-img-spfi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH] spi: tegra20-slink: add missing pm_runtime_put

2020-06-01 Thread Navid Emamdoost
Call to pm_runtime_get_sync increments counter even in case of failure leading to incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/spi/spi-tegra20-slink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-tegra20

[PATCH] spi: tegra20-slink: add missing pm_runtime_put if pm_runtime_get_sync fails

2020-06-01 Thread Navid Emamdoost
Call to pm_runtime_get_sync increments counter even in case of failure leading to incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/spi/spi-tegra20-slink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-tegra20

[PATCH] spi: tegra20-slink: call pm_runtime_put if pm_runtime_get_sync fails

2020-06-01 Thread Navid Emamdoost
Call to pm_runtime_get_sync increments counter even in case of failure leading to incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/spi/spi-tegra20-slink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-tegra20

[PATCH] spi: sprd: call pm_runtime_put if pm_runtime_get_sync fails

2020-06-01 Thread Navid Emamdoost
Call to pm_runtime_get_sync increments counter even in case of failure leading to incorrect ref count. Call pm_runtime_put_noidle if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/spi/spi-sprd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-sprd.c b

[PATCH] spi: tegra114: missing put on pm_runtime_get_sync failure

2020-06-01 Thread Navid Emamdoost
the call to pm_runtime_get_sync increments the counter even in case of failure leading to incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/spi/spi-tegra114.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi

[PATCH] spi: tegra20-sflash: call pm_runtime_put in case of pm_runtime_get failure

2020-06-01 Thread Navid Emamdoost
The counter is incremented via pm_runtime_get even in failure case. To correct the counter call pm_runtime_put in case of failure, too. Signed-off-by: Navid Emamdoost --- drivers/spi/spi-tegra20-sflash.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-tegra20-sflash.c b

[PATCH] spi: spi-ti-qspi: call pm_runtime_put on pm_runtime_get failure

2020-06-01 Thread Navid Emamdoost
The counter is incremented via pm_runtime_get even in failure case. To correct the counter call pm_runtime_put in case of failure, too. Signed-off-by: Navid Emamdoost --- drivers/spi/spi-ti-qspi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti

[PATCH] pwm: img: call pm_runtime_put in pm_runtime_get_sync failed case

2020-06-01 Thread Navid Emamdoost
Even in failed case of pm_runtime_get_sync, the usage_count is incremented. In order to keep the usage_count with correct value call appropriate put. Signed-off-by: Navid Emamdoost --- drivers/pwm/pwm-img.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pwm

[PATCH] power: supply: bq24190_charger.c: call pm_runtime_put in pm_runtime_get_sync failed case

2020-06-01 Thread Navid Emamdoost
From: Navid Even in failed case of pm_runtime_get_sync, the usage_count is incremented. In order to keep the usage_count with correct value call pm_runtime_put_autosuspend. Signed-off-by: Navid --- drivers/power/supply/bq24190_charger.c | 26 ++ 1 file changed, 18

[PATCH] power: supply: bq24190_charger.c: call pm_runtime_put in pm_runtime_get_sync failed case

2020-05-31 Thread Navid
Even in failed case of pm_runtime_get_sync, the usage_count is incremented. In order to keep the usage_count with correct value call pm_runtime_put_autosuspend. Signed-off-by: Navid --- drivers/power/supply/bq24190_charger.c | 26 ++ 1 file changed, 18 insertions(+), 8

Re: [PATCH] ath9k: release allocated buffer if timed out

2020-05-12 Thread Navid Emamdoost
Hi Brian, On Tue, May 12, 2020 at 11:57 AM Brian Norris wrote: > > On Fri, Sep 6, 2019 at 11:59 AM Navid Emamdoost > wrote: > > > > In ath9k_wmi_cmd, the allocated network buffer needs to be released > > if timeout happens. Otherwise memory will be leaked. > > &

Potential Race Condition in tls_hw_hash() and alike

2020-05-04 Thread Navid Emamdoost
n may happen? If yes, then is moving kref_put inside the lock a practical solution? Thank you, -- Navid.

Re: [PATCH] clocksource/drivers: Fix memory leak in ttc_setup_clockevent

2019-10-22 Thread Navid Emamdoost
ction implementation so that duplicate source code will be reduced. > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=7d194c2100ad2a6dded545887d02754948ca5241#n450 > > Just a note. Maybe you should also consider to fix this error path in > ttc_setup_clocksource() when notifier also can fail that there is no > need to continue with code execution. > > Thanks, > Michal -- Navid.

[PATCH] clocksource/drivers: Fix error handling in ttc_setup_clocksource

2019-10-22 Thread Navid Emamdoost
("arm: zynq: Use standard timer binding") Signed-off-by: Navid Emamdoost --- drivers/clocksource/timer-cadence-ttc.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-t

[PATCH v2] clocksource/drivers: Fix memory leak in ttc_setup_clockevent

2019-10-22 Thread Navid Emamdoost
In the implementation of ttc_setup_clockevent() release the allocated memory for ttcce if clk_notifier_register() fails. Fixes: 70504f311d4b ("clocksource/drivers/cadence_ttc: Convert init function to return error") Signed-off-by: Navid Emamdoost --- Changes in v2: - Added

[PATCH] clocksource/drivers/davinci: Fix memory leak in davinci_timer_register

2019-10-21 Thread Navid Emamdoost
In the impelementation of davinci_timer_register() the allocated memory for clockevent should be released if request_irq() fails. Fixes: 721154f972aa ("clocksource/drivers/davinci: Add support for clockevents") Signed-off-by: Navid Emamdoost --- drivers/clocksource/timer-davinci.c | 1

[PATCH] clocksource/drivers: Fix memory leak in ttc_setup_clockevent

2019-10-21 Thread Navid Emamdoost
In the impelementation of ttc_setup_clockevent() the allocated memory for ttcce should be released if clk_notifier_register() fails. Fixes: 70504f311d4b ("clocksource/drivers/cadence_ttc: Convert init function to return error") Signed-off-by: Navid Emamdoost --- drivers/clockso

[PATCH] locking/atomics: Fix memory leak in bcm2835_timer_init

2019-10-21 Thread Navid Emamdoost
In the impelementation of bcm2835_timer_init() the allocated memory for timer should be released if setup_irq() fails. Fixes: 84c39b8b7d46 ("clocksource/drivers/bcm2835_timer: Unmap region obtained by of_iomap") Signed-off-by: Navid Emamdoost --- drivers/clocksource/bcm2835_timer.

[PATCH] ipmi: Fix memory leak in __ipmi_bmc_register

2019-10-21 Thread Navid Emamdoost
In the impelementation of __ipmi_bmc_register() the allocated memory for bmc should be released in case ida_simple_get() fails. Fixes: 68e7e50f195f ("ipmi: Don't use BMC product/dev ids in the BMC name") Signed-off-by: Navid Emamdoost --- drivers/char/ipmi/ipmi_msghandler.c |

[PATCH] drm/amdgpu: Fix memory leak in amdgpu_fence_emit

2019-10-21 Thread Navid Emamdoost
In the impelementation of amdgpu_fence_emit() if dma_fence_wait() fails and returns an errno, before returning the allocated memory for fence should be released. Fixes: 3d2aca8c8620 ("drm/amdgpu: fix old fence check in amdgpu_fence_emit") Signed-off-by: Navid Emamdoost --- drivers/g

Re: [PATCH v2] apparmor: Fix use-after-free in aa_audit_rule_init

2019-10-21 Thread Navid Emamdoost
On Mon, Oct 21, 2019 at 10:45 AM Tyler Hicks wrote: > > On 2019-10-21 10:23:47, Navid Emamdoost wrote: > > In the implementation of aa_audit_rule_init(), when aa_label_parse() > > fails the allocated memory for rule is released using > > aa_audit_rule_free(). But after

[PATCH v3] apparmor: Fix use-after-free in aa_audit_rule_init

2019-10-21 Thread Navid Emamdoost
errNo and return it after release. Fixes: 52e8c38001d8 ("apparmor: Fix memory leak of rule on error exit path") Signed-off-by: Navid Emamdoost --- Changes in v3: -- applied Tyler Hicks recommendation on err initialization. security/apparmor/audit.c | 3 ++- 1 file changed, 2

Re: [PATCH] apparmor: Fix use-after-free in aa_audit_rule_init

2019-10-21 Thread Navid Emamdoost
he rule, copy errNo and return it > >> after releasing rule. > > > Navid thanks for finding this, and Markus thanks for the review > > > Please avoid a duplicate word and a typo in this change description. > > My preference would be a v2 version of the patch with the

[PATCH v2] apparmor: Fix use-after-free in aa_audit_rule_init

2019-10-21 Thread Navid Emamdoost
errNo and return it after release. Fixes: 52e8c38001d8 ("apparmor: Fix memory leak of rule on error exit path") Signed-off-by: Navid Emamdoost --- Changes in v2: -- Fix typo in description -- move err definition inside the if statement. security/apparmor/audit.c | 3 +

[PATCH] apparmor: Fix use-after-free in aa_audit_rule_init

2019-10-16 Thread Navid Emamdoost
, copy errNo and return it after releasing rule. Fixes: 52e8c38001d8 ("apparmor: Fix memory leak of rule on error exit path") Signed-off-by: Navid Emamdoost --- security/apparmor/audit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/security/apparmor/audit.c

Re: [PATCH 1/2] drm/imx: Fix error handling for a kmemdup() call in imx_pd_bind()

2019-10-12 Thread Navid Emamdoost
patch introduces a double-free. > + return -ENOMEM; > + } > + } > > ret = of_property_read_string(np, "interface-pix-fmt", &fmt); > if (!ret) { > -- > 2.23.0 > -- Navid.

[PATCH] clk: bcm2835: Fix memory leak in bcm2835_register_pll

2019-10-09 Thread Navid Emamdoost
In the implementation of bcm2835_register_pll(), the allocated memory for pll should be released if devm_clk_hw_register() fails. Fixes: b19f009d4510 ("clk: bcm2835: Migrate to clk_hw based registration and OF APIs") Signed-off-by: Navid Emamdoost --- drivers/clk/bcm/clk-bcm2835.c |

[PATCH] cpufreq/cpufreq_governor: Fix memory leak in cpufreq_dbs_governor_init

2019-10-09 Thread Navid Emamdoost
q: governor: split cpufreq_governor_dbs()") Signed-off-by: Navid Emamdoost --- drivers/cpufreq/cpufreq_governor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 4bb054d0cb43..deb099d36

[PATCH v2] media: usb: fix memory leak in af9005_identify_state

2019-10-09 Thread Navid Emamdoost
In af9005_identify_state when returning -EIO the allocated buffer should be released. Replace the "return -EIO" with assignment into ret and move deb_info() under a check. Fixes: af4e067e1dcf ("V4L/DVB (5625): Add support for the AF9005 demodulator from Afatech") Signed-off

Re: [PATCH] media: usb: fix memory leak in af9005_identify_state

2019-10-09 Thread Navid Emamdoost
Hi Hans, On Wed, Oct 9, 2019 at 7:42 AM Hans Verkuil wrote: > > On 9/14/19 1:55 AM, Navid Emamdoost wrote: > > In af9005_identify_state when returning -EIO the allocated buffer should > > be released. > > > > Signed-off-by: Navid Emamdoost > > --- > &g

Re: [PATCH] rtlwifi: fix memory leak in rtl_usb_probe

2019-10-05 Thread Navid Emamdoost
it.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3f93616951138a598d930dcaec40f2bfd9ce43bb > https://lore.kernel.org/lkml/20191001092047.71e8460...@smtp.codeaurora.org/ > https://lore.kernel.org/patchwork/comment/1331936/ > > Regards, > Markus -- Navid.

[PATCH] net: qlogic: Fix memory leak in ql_alloc_large_buffers

2019-10-04 Thread Navid Emamdoost
ffers(), and ql3xxx_send()") Signed-off-by: Navid Emamdoost --- drivers/net/ethernet/qlogic/qla3xxx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c index 457444894d80..b4b8ba00ee01 100644 --- a/drivers/net/ether

[PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_init_evt_ring

2019-10-04 Thread Navid Emamdoost
In mwifiex_pcie_init_evt_ring, a new skb is allocated which should be released if mwifiex_map_pci_memory() fails. The release for skb and card->evtbd_ring_vbase is added. Fixes: 0732484b47b5 ("mwifiex: separate ring initialization and ring creation routines") Signed-off-by: Na

[PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf

2019-10-04 Thread Navid Emamdoost
In mwifiex_pcie_alloc_cmdrsp_buf, a new skb is allocated which should be released if mwifiex_map_pci_memory() fails. The release is added. Fixes: fc3314609047 ("mwifiex: use pci_alloc/free_consistent APIs for PCIe") Signed-off-by: Navid Emamdoost --- drivers/net/wireless/marvell/mwif

  1   2   3   >