[PATCH] [v3] ieee802154: ca8210: Fix a potential UAF in ca8210_probe

2023-09-30 Thread Dinghao Liu
54: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Dinghao Liu --- Changelog: v2: -Remove the first clk_unregister() instead of nulling priv->clk. v3: -Simplify ca8210_register_ext_clock(). -Add a ';' after return in ca8210_unregister_ext_clock(). --- driv

Re: [PATCH] [v3] ieee802154: ca8210: Fix a potential UAF in ca8210_probe

2023-10-06 Thread dinghao . liu
t-20230929] > > [If your patch is applied to the wrong git tree, kindly drop us a note. > > And when submitting patch, we suggest to use '--base' as documented in > > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > > > url: > > ht

[PATCH] [v4] ieee802154: ca8210: Fix a potential UAF in ca8210_probe

2023-10-06 Thread Dinghao Liu
54: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Dinghao Liu --- Changelog: v2: -Remove the first clk_unregister() instead of nulling priv->clk. v3: -Simplify ca8210_register_ext_clock(). -Add a ';' after return in ca8210_unregister_ext_clock(). v4: -Remove an unu

[PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-06 Thread Dinghao Liu
quot;nd_btt: atomic sector updates") Signed-off-by: Dinghao Liu --- drivers/nvdimm/btt.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index d5593b0dc700..d8c4ba8bfdda 100644 --- a/drivers/nvdimm/btt.c +++ b/driv

Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-07 Thread dinghao . liu
> Dave Jiang wrote: > > > > [snip] > > First off thanks for the patch. This code seems to have a few things to > clean up. > > > > > On 12/6/23 20:43, Dinghao Liu wrote: > > > When an error happens in btt_freelist_init(), its caller > &g

Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-09 Thread dinghao . liu
> dinghao.liu@ wrote: > > > Dave Jiang wrote: > > [snip] > > > > That said, this patch does not completely fix freelist from leaking in the > > > following error path. > > > > > > discover_arenas() > > > btt_freelist_init() -> ok (memory allocated) > > > btt_rtt_init() -> f

[PATCH] [v2] nvdimm-btt: fix several memleaks

2023-12-10 Thread Dinghao Liu
->freelist a leaked memory. Fix these memleaks by using devm_kcalloc() to make the memory auto-freed on driver detach. Fixes: 5212e11fde4d ("nd_btt: atomic sector updates") Signed-off-by: Dinghao Liu --- Changelog: v2: -Use devm_kcalloc() to fix the memleaks. -Fix the potential lea

[PATCH] nvdimm-btt: simplify code with the scope based resource management

2023-12-10 Thread Dinghao Liu
Use the scope based resource management (defined in linux/cleanup.h) to automate resource lifetime control on struct btt_sb *super in discover_arenas(). Signed-off-by: Dinghao Liu --- drivers/nvdimm/btt.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers

Re: [PATCH] nvdimm-btt: simplify code with the scope based resource management

2023-12-12 Thread dinghao . liu
> > On 12/10/23 03:27, Dinghao Liu wrote: > > Use the scope based resource management (defined in > > linux/cleanup.h) to automate resource lifetime > > control on struct btt_sb *super in discover_arenas(). > > > > Signed-off-by: Dinghao Liu &g

Re: [PATCH] nvdimm-btt: simplify code with the scope based resource management

2023-12-13 Thread dinghao . liu
> > It's a little strange that we do not check super immediately after > > allocation. > > How about this: > > > > static int discover_arenas(struct btt *btt) > > { > > int ret = 0; > > struct arena_info *arena; > > - struct btt_sb *super; > > size_t remaining = bt

[PATCH] [v2] nvdimm-btt: simplify code with the scope based resource management

2023-12-14 Thread Dinghao Liu
Use the scope based resource management (defined in linux/cleanup.h) to automate resource lifetime control on struct btt_sb *super in discover_arenas(). Signed-off-by: Dinghao Liu --- Changelog: v2: Set the __free attribute before kzalloc. --- drivers/nvdimm/btt.c | 13 - 1 file

Re: [PATCH] [v2] nvdimm-btt: fix several memleaks

2023-12-18 Thread dinghao . liu
> Ira Weiny wrote: > > Dinghao Liu wrote: > > [snip] > > -static int btt_freelist_init(struct arena_info *arena) > +static int btt_freelist_init(struct device *dev, struct arena_info *arena) > > Both struct arena_info and struct btt contain references to struct nd

Re: [PATCH] [v2] nvdimm-btt: fix several memleaks

2023-12-20 Thread dinghao . liu
> dinghao.liu@ wrote: > > > Ira Weiny wrote: > > > > Dinghao Liu wrote: [snip] > > > > > > > > This does not quite work. > > > > > > > > free_arenas() is used in the error paths of create_arenas() and > > > >

[PATCH] ieee802154: ca8210: Fix a potential UAF in ca8210_probe

2023-09-25 Thread Dinghao Liu
ee may happen in the second time we call clk_unregister(). Fix this by nulling priv->clk after the first clk_unregister(). Also refine the pointer checking in ca8210_unregister_ext_clock(). Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Dingha

Re: [PATCH] ieee802154: ca8210: Fix a potential UAF in ca8210_probe

2023-09-25 Thread dinghao . liu
Hi Miquèl, > > index aebb19f1b3a4..1d545879c000 100644 > > --- a/drivers/net/ieee802154/ca8210.c > > +++ b/drivers/net/ieee802154/ca8210.c > > @@ -2760,6 +2760,7 @@ static int ca8210_register_ext_clock(struct > > spi_device *spi) > > ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->

[PATCH] [v2] ieee802154: ca8210: Fix a potential UAF in ca8210_probe

2023-09-25 Thread Dinghao Liu
54: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Dinghao Liu --- Changelog: v2: -Remove the first clk_unregister() instead of nulling priv->clk. --- drivers/net/ieee802154/ca8210.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ieee802154/

Re: [PATCH] [v2] ieee802154: ca8210: Fix a potential UAF in ca8210_probe

2023-09-26 Thread dinghao . liu
> Missing Cc stable, this needs to be backported. I will cc stable (sta...@vger.kernel.org) for the next version, thanks! > > diff --git a/drivers/net/ieee802154/ca8210.c > > b/drivers/net/ieee802154/ca8210.c > > index aebb19f1b3a4..b35c6f59bd1a 100644 > > --- a/drivers/net/ieee802154/ca8210.c >

[PATCH] ASoC: Intel: Skylake: Fix missing check in skl_pcm_trigger

2021-02-15 Thread Dinghao Liu
When cmd == SNDRV_PCM_TRIGGER_STOP, we should also check the return value of skl_decoupled_trigger() just like what we have done in case SNDRV_PCM_TRIGGER_PAUSE_RELEASE. Signed-off-by: Dinghao Liu --- sound/soc/intel/skylake/skl-pcm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound

Re: Re: [PATCH] ASoC: codecs: Fix rumtime PM imbalance in tas2552_probe

2021-04-07 Thread dinghao . liu
> On Wed, Apr 07, 2021 at 02:54:00PM +0800, Dinghao Liu wrote: > > > - pm_runtime_set_active(&client->dev); > > - pm_runtime_set_autosuspend_delay(&client->dev, 1000); > > - pm_runtime_use_autosuspend(&client->dev); > > - pm_runtime_enab

Re: Re: [PATCH] Input: cyapa - Fix rumtime PM imbalance on error

2021-04-07 Thread dinghao . liu
> Hi Dinghao, > > On Wed, Apr 07, 2021 at 12:07:38PM +0800, Dinghao Liu wrote: > > When mutex_lock_interruptible() fails, a pairing PM usage > > counter decrement is needed to keep the counter balanced. > > Thank you for the patch. > > > > > Signed

[PATCH] [v2] ASoC: codecs: Fix runtime PM imbalance in tas2552_probe

2021-04-07 Thread Dinghao Liu
There is a rumtime PM imbalance between the error handling path after devm_snd_soc_register_component() and all other error handling paths. Add a PM runtime increment to balance refcount. Signed-off-by: Dinghao Liu --- Changelog: v2: - Add a PM runtime increment to fix it instead of moving

[PATCH] media: atomisp: Fix error handling in atomisp_open

2021-04-07 Thread Dinghao Liu
Some error paths in atomisp_open will execute PM runtime decrement and unregister hmm pool even before we increase the PM refcount and registration. Fix this by adjusting jump labels on error. Signed-off-by: Dinghao Liu --- drivers/staging/media/atomisp/pci/atomisp_fops.c | 5 +++-- 1 file

[PATCH] media: ti-vpe: cal: Fix runtime PM imbalance in cal_probe

2021-04-08 Thread Dinghao Liu
pm_runtime_get_sync() will increase the rumtime PM counter even it returns an error. Thus a pairing decrement is needed to prevent refcount leak. Fix this by replacing this API with pm_runtime_resume_and_get(), which will not change the runtime PM counter on error. Signed-off-by: Dinghao Liu

[PATCH] dmaengine: tegra20: Fix runtime PM imbalance in tegra_dma_issue_pending

2021-04-08 Thread Dinghao Liu
pm_runtime_get_sync() will increase the rumtime PM counter even it returns an error. Thus a pairing decrement is needed to prevent refcount leak. Fix this by replacing this API with pm_runtime_resume_and_get(), which will not change the runtime PM counter on error. Signed-off-by: Dinghao Liu

[PATCH] slimbus: qcom-ngd-ctrl: Fix runtime PM imbalance in qcom_slim_ngd_enable

2021-04-08 Thread Dinghao Liu
When slim_register_controller() fails, a pairing PM usage counter increment is needed to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/slimbus/qcom-ngd-ctrl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd

[PATCH] PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe

2021-04-08 Thread Dinghao Liu
pm_runtime_get_sync() will increase the runtime PM counter even it returns an error. Thus a pairing decrement is needed to prevent refcount leak. Fix this by replacing this API with pm_runtime_resume_and_get(), which will not change the runtime PM counter on error. Signed-off-by: Dinghao Liu

[PATCH] PCI: tegra: Fix runtime PM imbalance in pex_ep_event_pex_rst_deassert

2021-04-08 Thread Dinghao Liu
pm_runtime_get_sync() will increase the runtime PM counter even it returns an error. Thus a pairing decrement is needed to prevent refcount leak. Fix this by replacing this API with pm_runtime_resume_and_get(), which will not change the runtime PM counter on error. Signed-off-by: Dinghao Liu

[PATCH] media: atomisp: Fix runtime PM imbalance in atomisp_pci_probe

2021-04-08 Thread Dinghao Liu
When hmm_pool_register() fails, a pairing PM usage counter increment is needed to keep the counter balanced. It's the same for the following error paths. Signed-off-by: Dinghao Liu --- drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dr

[PATCH] media: imx: imx7-mipi-csis: Fix runtime PM imbalance in mipi_csis_s_stream

2021-04-08 Thread Dinghao Liu
When v4l2_subdev_call() fails, a pairing PM usage counter decrement is needed to keep the counter balanced. It's the same for the following error paths in case 'enable' is on. Signed-off-by: Dinghao Liu --- drivers/staging/media/imx/imx7-mipi-csis.c | 9 +++-- 1 file change

[PATCH] spi: spi-zynqmp-gqspi: Fix runtime PM imbalance in zynqmp_qspi_probe

2021-04-08 Thread Dinghao Liu
When platform_get_irq() fails, a pairing PM usage counter increment is needed to keep the counter balanced. It's the same for the following error paths. Signed-off-by: Dinghao Liu --- drivers/spi/spi-zynqmp-gqspi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-z

Re: Re: [PATCH] spi: spi-zynqmp-gqspi: Fix runtime PM imbalance in zynqmp_qspi_probe

2021-04-09 Thread dinghao . liu
> Hi Dinghao, > > On 4/8/21 6:33 PM, Michal Simek wrote: > > ++ > > > > On 4/8/21 11:25 AM, Dinghao Liu wrote: > >> When platform_get_irq() fails, a pairing PM usage counter > >> increment is needed to keep the counter balanced. It's the > &g

Re: Re: [PATCH] media: imx: imx7-mipi-csis: Fix runtime PM imbalance in mipi_csis_s_stream

2021-04-09 Thread dinghao . liu
> Hi Liu, > Thanks for your patch. > > On Thu, Apr 08, 2021 at 05:08:27PM +0800, Dinghao Liu wrote: > > When v4l2_subdev_call() fails, a pairing PM usage counter > > decrement is needed to keep the counter balanced. It's the > > same for the following

[PATCH] [v2] media: imx: imx7-mipi-csis: Fix runtime PM imbalance in mipi_csis_s_stream

2021-04-09 Thread Dinghao Liu
When v4l2_subdev_call() fails, a pairing PM usage counter decrement is needed to keep the counter balanced. It's the same for the following error paths in case 'enable' is on. Signed-off-by: Dinghao Liu --- Changelog: v2: - Use pm_runtime_put() to balance the refcount. ---

Re: Re: [PATCH] dmaengine: tegra20: Fix runtime PM imbalance in tegra_dma_issue_pending

2021-04-09 Thread dinghao . liu
> On 08/04/2021 08:11, Dinghao Liu wrote: > > pm_runtime_get_sync() will increase the rumtime PM counter > > even it returns an error. Thus a pairing decrement is needed > > to prevent refcount leak. Fix this by replacing this API with > > pm_runtime_resume_and_get()

[PATCH] [v2] dmaengine: tegra20: Fix runtime PM imbalance on error

2021-04-09 Thread Dinghao Liu
pm_runtime_get_sync() will increase the runtime PM counter even it returns an error. Thus a pairing decrement is needed to prevent refcount leak. Fix this by replacing this API with pm_runtime_resume_and_get(), which will not change the runtime PM counter on error. Signed-off-by: Dinghao Liu

Re: Re: [PATCH] ASoC: Intel: Skylake: Fix missing check in skl_pcm_trigger

2021-02-18 Thread dinghao . liu
> > On 2/15/21 7:13 AM, Dinghao Liu wrote: > > When cmd == SNDRV_PCM_TRIGGER_STOP, we should also check > > the return value of skl_decoupled_trigger() just like what > > we have done in case SNDRV_PCM_TRIGGER_PAUSE_RELEASE. > > > > Signed-off-by: Dinghao Liu

[PATCH] ALSA: intel8x0: Fix missing check in snd_intel8x0m_create

2021-01-31 Thread Dinghao Liu
When device_type == DEVICE_ALI, we should also check the return value of pci_iomap() to avoid potential null pointer dereference. Signed-off-by: Dinghao Liu --- sound/pci/intel8x0m.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/pci/intel8x0m.c b/sound/pci

[PATCH] RDMA/siw: Fix missing check in siw_get_hdr

2021-02-25 Thread Dinghao Liu
We should also check the range of opcode after calling __rdmap_get_opcode() in the else branch to prevent potential overflow. Fixes: 8b6a361b8c482 ("rdma/siw: receive path") Signed-off-by: Dinghao Liu --- drivers/infiniband/sw/siw/siw_qp_rx.c | 10 ++ 1 file changed, 10

[PATCH] mmc: sdhci-pci-o2micro: Add missing checks in sdhci_pci_o2_probe

2021-02-26 Thread Dinghao Liu
It's odd to adopt different error handling on failure of pci_read_config_dword(). Check the return value and terminate execution flow on failure of all pci_read_config_dword() calls in this function. Signed-off-by: Dinghao Liu --- drivers/mmc/host/sdhci-pci-o2micro.c | 8 1

Re: Re: [PATCH] RDMA/siw: Fix missing check in siw_get_hdr

2021-02-26 Thread dinghao . liu
"Bernard Metzler" <b...@zurich.ibm.com>写道: > -"Dinghao Liu" wrote: - > > >To: dinghao....@zju.edu.cn, k...@umn.edu > >From: "Dinghao Liu" > >Date: 02/26/2021 08:56AM > >Cc: "Bernard Metzler" , "D

[PATCH] [v2] i2c: imx-lpi2c: Fix runtime PM imbalance on error

2020-05-30 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- Changelog: v2: - Use pm_runtime_put_noidle() instead of

Re: Re: [PATCH v2] i2c: imx-lpi2c: Fix runtime PM imbalance on error in lpi2c_imx_master_enable()

2020-05-31 Thread dinghao . liu
Hi, Markus, > * How do you think about to replace the word “pairing” by “corresponding”? > > * Will it be helpful to add an imperative wording? > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=ffeb595d84811dde16a28b33

Re: Re: [PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()

2020-05-31 Thread dinghao . liu
> > > It's the same when gm20b_clk_new() returns from elsewhere following this > > call. > > I suggest to reconsider the interpretation of the software situation once > more. > Can it be that the allocated clock object should be kept usable even after > a successful return from this function? >

Re: Re: drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()

2020-05-31 Thread dinghao . liu
> > > For security, I will release this pointer only on error paths in this > > function. > > Do you tend to release objects (which are referenced by pointers)? > I just found that clk is referenced by pclk in this function. When clk is freed, pclk will be allocated in gm20b_clk_new_speedo0(

Re: Re: drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()

2020-05-31 Thread dinghao . liu
> > I just found that clk is referenced by pclk in this function. When clk is > > freed, > > pclk will be allocated in gm20b_clk_new_speedo0(). Thus we should not > > release clk > > in this function and there is no bug here. > > Can there be a need to release a clock object after a failed gk20a

Re: Re: drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()

2020-05-31 Thread dinghao . liu
> > If gk20a_clk_ctor() never returns such an error code, > > we may need not to release this clock object. > > Would you like to achieve complete exception handling > also for this function implementation? > It seems that it's possible to get -ENOMEM from gk20a_clk_ctor(). The call chain is as

Re: Re: [PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new

2020-05-31 Thread dinghao . liu
Hi Ben, > > When gk20a_clk_ctor() returns an error code, pointer "clk" > > should be released. It's the same when gm20b_clk_new() > > returns from elsewhere following this call. > This shouldn't be necessary. If a subdev constructor fails, and > returns a pointer, the core will call the destruct

Re: Re: Re: [PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new

2020-05-31 Thread dinghao . liu
> > If there's *any* error, it'll check the pointer, if it's non-NULL, > > it'll call the destructor. If kzalloc() fails, the pointer will be > > NULL, there's no double-free bug. *every* subdev is written this way > > to avoid duplicating cleanup logic. > Actually, gm20b_clk_new_speedo0() may ha

[PATCH] [v3] i2c: imx-lpi2c: Fix runtime PM imbalance on error

2020-05-31 Thread Dinghao Liu
me pm support") Co-developed-by: Markus Elfring Signed-off-by: Markus Elfring Signed-off-by: Dinghao Liu --- Changelog: v2: - Use pm_runtime_put_noidle() instead of pm_runtime_put_autosuspend(). v3: - Refine commit message. --- drivers/i2c/busses/i2c-imx-lpi2c.c | 4 +++- 1 file

[PATCH] crypto: sun8i-ce - fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 4 +++- 1 file changed, 3

[PATCH] power: supply: bq24190_charger: fix runtime pm imbalance

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/power/supply/bq24190_charger.c | 4 +++- 1 file changed, 3 insertions

[PATCH] crypto: sun8i-ss - fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 + 1 file changed, 1

[PATCH] crypto: sun8i-ss - fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 4 +++- 1 file changed, 3

[PATCH] PCI: rcar: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/pci/controller/pcie-rcar.c | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH] PCI: tegra: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
-off-by: Dinghao Liu --- drivers/pci/controller/pci-tegra.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c index 3e64ba6a36a8..00236dd65b5b 100644 --- a/drivers/pci/controller/pci-tegra.c +++ b/drivers

[PATCH] PCI: dwc: pci-dra7xx: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/pci/controller/dwc/pci-dra7xx.c | 3 +-- 1 file changed, 1 insertion

[PATCH] PCI: qcom: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/pci/controller/dwc/pcie-qcom.c | 3 +-- 1 file changed, 1 insertion

[PATCH] PCI: tegra: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/pci/controller/dwc/pcie-tegra194.c | 2 +- 1 file changed, 1 insertion

[PATCH] PCI: cadence: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/pci/controller/cadence/pcie-cadence-plat.c | 3 +-- 1 file changed, 1

[PATCH] media: staging: tegra-vde: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/staging/media/tegra-vde/vde.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] drm/etnaviv: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 +++ 1 file changed, 3

[PATCH] drm/nouveau/debugfs: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/gpu/drm/nouveau/nouveau_debugfs.c | 5 - 1 file changed, 4

[PATCH] drm/nouveau: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/gpu/drm/nouveau/nouveau_gem.c | 4 +++- 1 file changed, 3

[PATCH] drm/nouveau: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- 1 file changed, 1 insertion

[PATCH] drm/nouveau/dispnv50: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +++- 1 file changed, 3

[PATCH] drm/panfrost: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/gpu/drm/panfrost/panfrost_job.c | 4 +++- 1 file changed, 3

[PATCH] drm/v3d: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/gpu/drm/v3d/v3d_gem.c | 4 +++- 1 file changed, 3 insertions

[PATCH] can: xilinx_can: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/net/can/xilinx_can.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] wlcore: fix runtime pm imbalance in wl1271_tx_work

2020-05-20 Thread Dinghao Liu
There are two error handling paths in this functon. When wlcore_tx_work_locked() returns an error code, we should decrease the runtime PM usage counter the same way as the error handling path beginning from pm_runtime_get_sync(). Signed-off-by: Dinghao Liu --- drivers/net/wireless/ti/wlcore

[PATCH] wlcore: fix runtime pm imbalance in wlcore_regdomain_config

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/net/wireless/ti/wlcore/main.c | 4 +++- 1 file changed, 3

[PATCH] wlcore: fix runtime pm imbalance in wl1271_op_suspend

2020-05-20 Thread Dinghao Liu
When wlcore_hw_interrupt_notify() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/net/wireless/ti/wlcore/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net

[PATCH] wlcore: fix runtime pm imbalance in __wl1271_op_remove_interface

2020-05-20 Thread Dinghao Liu
When wl12xx_cmd_role_disable() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/net/wireless/ti/wlcore/main.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net

[PATCH] hwrng: exynos - fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/char/hw_random/exynos-trng.c | 3 +-- 1 file changed, 1 insertion

[PATCH] hwrng: ks-sa - fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/char/hw_random/ks-sa-rng.c | 1 + 1 file changed, 1 insertion

[PATCH] Input: omap-keypad - fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/input/keyboard/omap4-keypad.c | 2 +- 1 file changed, 1 insertion

[PATCH] i2c: imx-lpi2c: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/i2c/busses/i2c-imx-lpi2c.c | 4 +++- 1 file changed, 3 insertions

[PATCH] [v2] PCI: tegra: Fix runtime PM imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Also, call pm_runtime_disable() when pm_runtime_get_sync() returns an error code. Signed-off-by: Dinghao

Re: Re: [PATCH] PCI: tegra: fix runtime pm imbalance on error

2020-05-20 Thread dinghao . liu
Thank you for your advice. I think tegra194 is a good choice and I will use it in the next edition of patch. "Bjorn Helgaas" <helg...@kernel.org>写道: > On Wed, May 20, 2020 at 11:59:08AM +0200, Thierry Reding wrote: > > On Wed, May 20, 2020 at 04:52:23PM

Re: Re: [PATCH] PCI: tegra: fix runtime pm imbalance on error

2020-05-20 Thread dinghao . liu
Thank you for your advice. I will fix these problems in the next edition of patch. "Thierry Reding" <thierry.red...@gmail.com>写道: > On Wed, May 20, 2020 at 04:52:23PM +0800, Dinghao Liu wrote: > > pm_runtime_get_sync() increments the runtime PM usage counter even >

[PATCH] [v2] PCI: tegra194: Fix runtime PM imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/pci/controller/dwc/pcie-tegra194.c | 5 ++--- 1 file changed, 2

Re: Re: [PATCH] media: staging: tegra-vde: fix runtime pm imbalance on error

2020-05-20 Thread dinghao . liu
+0300, Dmitry Osipenko wrote: > > 20.05.2020 12:51, Dinghao Liu пишет: > > > pm_runtime_get_sync() increments the runtime PM usage counter even > > > it returns an error code. Thus a pairing decrement is needed on > > > the error handling path to keep the counte

Re: Re: [PATCH] wlcore: fix runtime pm imbalance in wl1271_op_suspend

2020-05-20 Thread dinghao . liu
There is a check against ret after out_sleep tag. If wl1271_configure_suspend_ap() returns an error code, ret will be caught by this check and a warning will be issued. "Tony Lindgren" <t...@atomide.com>写道: > * Dinghao Liu [200520 12:58]: > > When wlcore_hw_interrupt_

Re: Re: [PATCH] Input: omap-keypad - fix runtime pm imbalance on error

2020-05-20 Thread dinghao . liu
Fixing this in the PM core will influence all callers of pm_runtime_get_sync(). Therefore I think the better solution is to fix its misused callers. Regards, Dinghao "Dmitry Torokhov" <dmitry.torok...@gmail.com>写道: > Hi Dinghao, > > On Wed, May 20, 2020 at 6

Re: Re: [PATCH] hwrng: ks-sa - fix runtime pm imbalance on error

2020-05-20 Thread dinghao . liu
individually. Dinghao > Hello Dinghao, > > On Wed, 2020-05-20 at 21:29 +0800, Dinghao Liu wrote: > > pm_runtime_get_sync() increments the runtime PM usage counter even > > the call returns an error code. Thus a pairing decrement is needed > > on the error handling path t

[PATCH] [v2] media: staging: tegra-vde: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- Changelog: v2: - Remove unused label 'unlock' --- drivers/sta

Re: Re: [PATCH] drm/panfrost: fix runtime pm imbalance on error

2020-05-21 Thread dinghao . liu
Regards, Dinghao > On 20/05/2020 12:05, Dinghao Liu wrote: > > pm_runtime_get_sync() increments the runtime PM usage counter even > > the call returns an error code. Thus a pairing decrement is needed > > on the error handling path to keep the counter balanced. > &

[PATCH] i2c: stm32f7: Fix runtime PM imbalance in stm32f7_i2c_reg_slave

2020-05-21 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/i2c/busses/i2c-stm32f7.c | 4 +++- 1 file changed, 3 insertions

[PATCH] i2c: stm32f7: Fix runtime PM imbalance in stm32f7_i2c_unreg_slave

2020-05-21 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/i2c/busses/i2c-stm32f7.c | 4 +++- 1 file changed, 3 insertions

[PATCH] xhci: Fix runtime PM imbalance on error

2020-05-21 Thread Dinghao Liu
When dma_set_mask_and_coherent() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. Also, call pm_runtime_disable() when dma_set_mask_and_coherent() returns an error code. Signed-off-by: Dinghao Liu --- drivers/usb/host/xhci-histb.c | 2

[PATCH] usb: musb: Fix runtime PM imbalance on error

2020-05-21 Thread Dinghao Liu
When copy_from_user() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/usb/musb/musb_debugfs.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb

[PATCH] usb: cdns3: Fix runtime PM imbalance on error

2020-05-21 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/usb/cdns3/cdns3-ti.c | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH] spi: spi-ti-qspi: Fix runtime PM imbalance on error

2020-05-21 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/spi/spi-ti-qspi.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH] spi: tegra20-slink: Fix runtime PM imbalance on error

2020-05-21 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/spi/spi-tegra20-slink.c | 1 + 1 file changed, 1 insertion

[PATCH] spi: tegra20-sflash: Fix runtime PM imbalance on error

2020-05-21 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/spi/spi-tegra20-sflash.c | 1 + 1 file changed, 1 insertion

[PATCH] spi: tegra114: Fix runtime PM imbalance on error

2020-05-21 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/spi/spi-tegra114.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH] watchdog: Fix runtime PM imbalance on error

2020-05-21 Thread Dinghao Liu
When watchdog_register_device() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/watchdog/omap_wdt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/watchdog/omap_wdt.c b/drivers

[PATCH] dmaengine: tegra210-adma: Fix runtime PM imbalance on error

2020-05-21 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/dma/tegra210-adma.c | 3 +-- 1 file changed, 1 insertion(+), 2

Re: Re: [PATCH] spi: tegra20-slink: Fix runtime PM imbalance on error

2020-05-21 Thread dinghao . liu
Andy Shevchenko > wrote: > > On Thu, May 21, 2020 at 10:50 AM Dinghao Liu wrote: > > Any I have coccinelle script for this, I can share with you. > > -- > With Best Regards, > Andy Shevchenko

[PATCH] dmaengine: ti: edma: Fix runtime PM imbalance on error

2020-05-21 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/dma/ti/edma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions

[PATCH] sata_rcar: Fix runtime PM imbalance on error

2020-05-21 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/ata/sata_rcar.c | 3 +-- 1 file changed, 1 insertion(+), 2

  1   2   3   4   >