Re: [PATCH] malidp: no need to check return value of debugfs_create functions

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

 



On Thu, Jun 13, 2019 at 03:52:22PM +0100, Liviu Dudau wrote:
> On Thu, Jun 13, 2019 at 03:28:29PM +0200, Greg Kroah-Hartman wrote:
> > When calling debugfs functions, there is no need to ever check the
> > return value.  The function can work or not, but the code logic should
> > never do something different based on this.
> 
> I remember when writing this code and testing not fully complete code that left
> nodes around on removing the module that there were errors being returned by
> debugfs_create_file(). Has that changed since 2 years ago? :)

Errors can be returned if you do something foolish:
	- pass an error as a parent pointer
	- pass a name that is already present
or if the system is out of resources
	- can not increment superblock reference
	- out of memory to create an inode

If those last two things are happening, then your system is crashing
already, debugfs is the least of your worries :)

> > Cc: Liviu Dudau <liviu.dudau@xxxxxxx>
> > Cc: Brian Starkey <brian.starkey@xxxxxxx>
> > Cc: David Airlie <airlied@xxxxxxxx>
> > Cc: Daniel Vetter <daniel@xxxxxxxx>
> > Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> > Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> 
> Acked-by: Liviu Dudau <liviu.dudau@xxxxxxx>
> 
> I'll pull it into the malidp tree.

Wonderful, thanks!

greg k-h
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[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