* [PATCH] usb: cdns3: adjust the partial logic of cdnsp_pci_remove
@ 2022-10-09 5:32 Dongliang Mu
2022-10-09 6:53 ` Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Dongliang Mu @ 2022-10-09 5:32 UTC (permalink / raw)
To: Pawel Laszczak, Greg Kroah-Hartman; +Cc: Dongliang Mu, linux-usb, linux-kernel
From: Dongliang Mu <mudongliangabcd@gmail.com>
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.
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
---
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.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: cdns3: adjust the partial logic of cdnsp_pci_remove
2022-10-09 5:32 [PATCH] usb: cdns3: adjust the partial logic of cdnsp_pci_remove Dongliang Mu
@ 2022-10-09 6:53 ` Greg Kroah-Hartman
2022-10-09 7:33 ` Dongliang Mu
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2022-10-09 6:53 UTC (permalink / raw)
To: Dongliang Mu; +Cc: Pawel Laszczak, Dongliang Mu, linux-usb, linux-kernel
On Sun, Oct 09, 2022 at 01:32:45PM +0800, Dongliang Mu wrote:
> From: Dongliang Mu <mudongliangabcd@gmail.com>
>
> 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.
>
> Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Your email address does not match your From: address, and your From:
address is saying it is being spoofed and not correct :(
Please work with your school to fix your email system and do not use
gmail to hide it.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: cdns3: adjust the partial logic of cdnsp_pci_remove
2022-10-09 6:53 ` Greg Kroah-Hartman
@ 2022-10-09 7:33 ` Dongliang Mu
0 siblings, 0 replies; 5+ messages in thread
From: Dongliang Mu @ 2022-10-09 7:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Dongliang Mu, Pawel Laszczak, linux-usb, linux-kernel
On Sun, Oct 9, 2022 at 2:52 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Sun, Oct 09, 2022 at 01:32:45PM +0800, Dongliang Mu wrote:
> > From: Dongliang Mu <mudongliangabcd@gmail.com>
> >
> > 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.
> >
> > Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
>
> Your email address does not match your From: address, and your From:
> address is saying it is being spoofed and not correct :(
>
> Please work with your school to fix your email system and do not use
> gmail to hide it.
My git config uses Gmail. I forget to change this after I joined the
new school and changed sendmail configuration.
I sent a new version several minutes ago.
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] usb: cdns3: adjust the partial logic of cdnsp_pci_remove
2022-10-09 7:23 Dongliang Mu
@ 2022-10-10 4:27 ` Pawel Laszczak
0 siblings, 0 replies; 5+ messages in thread
From: Pawel Laszczak @ 2022-10-10 4:27 UTC (permalink / raw)
To: Dongliang Mu, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel
>
>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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] usb: cdns3: adjust the partial logic of cdnsp_pci_remove
@ 2022-10-09 7:23 Dongliang Mu
2022-10-10 4:27 ` Pawel Laszczak
0 siblings, 1 reply; 5+ messages in thread
From: Dongliang Mu @ 2022-10-09 7:23 UTC (permalink / raw)
To: Pawel Laszczak, Greg Kroah-Hartman; +Cc: Dongliang Mu, linux-usb, linux-kernel
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.
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-10-10 5:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-09 5:32 [PATCH] usb: cdns3: adjust the partial logic of cdnsp_pci_remove Dongliang Mu
2022-10-09 6:53 ` Greg Kroah-Hartman
2022-10-09 7:33 ` Dongliang Mu
2022-10-09 7:23 Dongliang Mu
2022-10-10 4:27 ` Pawel Laszczak
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).