lkml.org 
[lkml]   [2022]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tty: nozomi: Return an error when failing to create the sysfs
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

\
 
 \ /
  Last update: 2022-06-09 15:21    [W:2.574 / U:1.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site