From: Pawel Laszczak <pawell@cadence.com>
To: Dongliang Mu <dzm91@hust.edu.cn>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] usb: cdns3: adjust the partial logic of cdnsp_pci_remove
Date: Mon, 10 Oct 2022 04:27:15 +0000 [thread overview]
Message-ID: <BYAPR07MB53817EF4EACBA1CECEED97FDDD209@BYAPR07MB5381.namprd07.prod.outlook.com> (raw)
In-Reply-To: <20221009072305.1593707-1-dzm91@hust.edu.cn>
>
>In cdnsp_pci_remove, if pci_is_enabled returns true, it will
>call cdns_remove; else it will call kfree. Then both control flow
>goes to pci_dev_put.
>
>Adjust this logic by modifying it to an if else.
>
Acked-by: Pawel Laszczak <pawell@cadence.com>
Thanks
Pawel,
>Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
>---
> drivers/usb/cdns3/cdnsp-pci.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
>diff --git a/drivers/usb/cdns3/cdnsp-pci.c b/drivers/usb/cdns3/cdnsp-pci.c
>index fe8a114c586c..efd54ed918b9 100644
>--- a/drivers/usb/cdns3/cdnsp-pci.c
>+++ b/drivers/usb/cdns3/cdnsp-pci.c
>@@ -192,14 +192,12 @@ static void cdnsp_pci_remove(struct pci_dev *pdev)
> if (pci_dev_run_wake(pdev))
> pm_runtime_get_noresume(&pdev->dev);
>
>- if (!pci_is_enabled(func)) {
>+ if (pci_is_enabled(func)) {
>+ cdns_remove(cdnsp);
>+ } else {
> kfree(cdnsp);
>- goto pci_put;
> }
>
>- cdns_remove(cdnsp);
>-
>-pci_put:
> pci_dev_put(func);
> }
>
>--
>2.25.1
next prev parent reply other threads:[~2022-10-10 5:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-09 7:23 [PATCH] usb: cdns3: adjust the partial logic of cdnsp_pci_remove Dongliang Mu
2022-10-10 4:27 ` Pawel Laszczak [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-10-09 5:32 Dongliang Mu
2022-10-09 6:53 ` Greg Kroah-Hartman
2022-10-09 7:33 ` Dongliang Mu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BYAPR07MB53817EF4EACBA1CECEED97FDDD209@BYAPR07MB5381.namprd07.prod.outlook.com \
--to=pawell@cadence.com \
--cc=dzm91@hust.edu.cn \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).