Re: Fw: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 11, 2021 at 04:19:58PM +0200, Christian König wrote:
> > > > > And then throw it away, later, when you want to remove the directory,
> > > > > look it up with a call to debugfs_lookup() and pass that to
> > > > > debugfs_remove() (which does so recursively).
> > > > > 
> > > > > There should never be a need to save, or check, the result of any
> > > > > debugfs call.  If so, odds are it is being used incorrectly.
> > > Yeah, exactly that's the problem I see here.
> > > 
> > > We save the return value because the DRM subsystem is creating a debugfs
> > > directory for the drivers to use.
> > That's fine for now, not a big deal.  And even if there is an error,
> > again, you can always feed that error back into the debugfs subsystem on
> > another call and it will handle it correctly.
> 
> Problem is it isn't, we have a crash because the member isn't a pointer but
> an ERR_PTR instead.

Again, that is fine, you can feed that into debugfs and it will "just
work".  Treat it as an opaque pointer, not a *dentry and you will be
fine.

thanks,

greg k-h



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux