From: Greg KH <gregkh@linuxfoundation.org>
To: Zheyu Ma <zheyuma97@gmail.com>
Cc: Jiri Slaby <jirislaby@kernel.org>,
fseidel@suse.de,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tty: nozomi: Return an error when failing to create the sysfs
Date: Thu, 9 Jun 2022 15:18:17 +0200 [thread overview]
Message-ID: <YqHzGeRK0c4nVPc6@kroah.com> (raw)
In-Reply-To: <CAMhUBj=nTiTu8wwjk0=WGE=nJPWtb+kSq_u=MW_FF1DHLE-55A@mail.gmail.com>
On Thu, Jun 09, 2022 at 07:03:32PM +0800, Zheyu Ma wrote:
> On Thu, Jun 9, 2022 at 4:38 PM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Thu, Jun 09, 2022 at 04:31:33PM +0800, Zheyu Ma wrote:
> > > The driver does not handle the error of the creation of sysfs, resulting
> > > in duplicate file names being created.
> > >
> > > The following log can reveal it:
> > >
> > > [ 52.907211] sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:05.0/card_type'
> >
> > How is the same file being created in a normal codepath?
> >
> > Is the same device being registered twice somehow?
>
> In fact, I tried to load the nozomi driver twice.
How? Modules should not be able to be in memory twice.
> In the first load, the driver failed at tty_port_register_device(),
> performed error handling and returned an error, but by this time the
> make_sysfs_files() had been executed and the sysfs had been created.
> In the second load, the make_sysfs_files() is executed again and this
> warning is returned.
Ah, ok, if you make the other changes I suggested, this will not be a
problem.
thanks,
greg k-h
prev parent reply other threads:[~2022-06-09 13:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-09 8:31 [PATCH] tty: nozomi: Return an error when failing to create the sysfs Zheyu Ma
2022-06-09 8:38 ` Greg KH
2022-06-09 11:03 ` Zheyu Ma
2022-06-09 13:18 ` Greg KH [this message]
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=YqHzGeRK0c4nVPc6@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=fseidel@suse.de \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zheyuma97@gmail.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