From: Greg KH <gregkh@linuxfoundation.org>
To: Ruan Jinjie <ruanjinjie@huawei.com>
Cc: jirislaby@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] tty: moxa: add missing pci_disable_device()
Date: Fri, 23 Sep 2022 13:25:23 +0200 [thread overview]
Message-ID: <Yy2Xo30/WB9rja13@kroah.com> (raw)
In-Reply-To: <95e4a84f-dcc6-72cd-69a0-3ba59ea73a9c@huawei.com>
On Fri, Sep 23, 2022 at 06:12:03PM +0800, Ruan Jinjie wrote:
>
>
> On 2022/9/23 17:56, Greg KH wrote:
> > On Fri, Sep 23, 2022 at 05:25:30PM +0800, ruanjinjie wrote:
> >> Driver should call pci_disable_device() if it returns from
> >> moxa_pci_probe() with error.
> >
> > Why?
> >
> > That is not a normal thing to do, as you can disable other PCI devices
> > attached to it, right?
> >
> >> Meanwhile, the driver calls pci_enable_device() in
> >> moxa_pci_probe(), but never calls pci_disable_device() during removal.
> >
> > And is that really a problem?
> >
> >>
> >> Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
> >> ---
> >> drivers/tty/moxa.c | 4 +++-
> >> 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > Do you have this hardware to test with?
> >
> > How did you find this issue?
> >
>
> We use static analysis via coccinelle to find the above issue. The
> command we use is below:
>
> spatch -I include -timeout 60 -very_quiet -sp_file
> pci_disable_device_missing.cocci drivers/tty/moxa.c
Please test with real hardware and look up what pci_disable_device()
does.
greg k-h
next prev parent reply other threads:[~2022-09-23 11:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-23 9:25 ruanjinjie
2022-09-23 9:56 ` Greg KH
2022-09-23 10:12 ` Ruan Jinjie
2022-09-23 11:25 ` Greg KH [this message]
2022-09-24 0:58 ` Ruan Jinjie
2022-09-24 2:21 ` Ruan Jinjie
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=Yy2Xo30/WB9rja13@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ruanjinjie@huawei.com \
/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
all inboxes | Powered by JetHome®