lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 7 Dec 2021 09:39:24 +0800
From:   Baolin Wang <baolin.wang7@...il.com>
To:     Dongliang Mu <mudongliangabcd@...il.com>
Cc:     Vinod Koul <vkoul@...nel.org>, Orson Zhai <orsonzhai@...il.com>,
        Chunyan Zhang <zhang.lyra@...il.com>,
        Baolin Wang <baolin.wang@...eadtrum.com>,
        dmaengine@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] dmaengine: sprd: move pm_runtime_disable to err_rpm

Hi Dongliang,

On Mon, Dec 6, 2021 at 7:34 PM Dongliang Mu <mudongliangabcd@...il.com> wrote:
>
> When pm_runtime_get_sync fails, it forgets to invoke pm_runtime_disable
> in the label err_rpm.
>
> Fix this by moving pm_runtime_disable to label err_rpm.
>
> Fixes: 9b3b8171f7f4 ("dmaengine: sprd: Add Spreadtrum DMA driver")
> Signed-off-by: Dongliang Mu <mudongliangabcd@...il.com>
> ---

Thanks for your patch, but looking at the code in detail, I think we
also should decrease the rpm counter when failing to call the
pm_runtime_get_sync().

--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -1210,7 +1210,7 @@ static int sprd_dma_probe(struct platform_device *pdev)
        ret = dma_async_device_register(&sdev->dma_dev);
        if (ret < 0) {
                dev_err(&pdev->dev, "register dma device failed:%d\n", ret);
-               goto err_register;
+               goto err_rpm;
        }

        sprd_dma_info.dma_cap = sdev->dma_dev.cap_mask;
@@ -1224,10 +1224,9 @@ static int sprd_dma_probe(struct platform_device *pdev)

 err_of_register:
        dma_async_device_unregister(&sdev->dma_dev);
-err_register:
+err_rpm:
        pm_runtime_put_noidle(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
-err_rpm:
        sprd_dma_disable(sdev);
        return ret;
 }

-- 
Baolin Wang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ