> > On Tue, Jun 18, 2019 at 05:58:41PM +0000, Winkler, Tomas wrote: > > > > > > > > Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx> > > > > > > > --- > > > > drivers/watchdog/mei_wdt.c | 30 +++++++----------------------- > > > > 1 file changed, 7 insertions(+), 23 deletions(-) > > > > > > > > diff --git a/drivers/watchdog/mei_wdt.c > > > > b/drivers/watchdog/mei_wdt.c index 8023cf28657a..96a770938ff0 > > > > 100644 > > > > --- a/drivers/watchdog/mei_wdt.c > > > > +++ b/drivers/watchdog/mei_wdt.c > > > > @@ -539,38 +539,23 @@ static void dbgfs_unregister(struct mei_wdt > *wdt) > > > > wdt->dbgfs_dir = NULL; > > > > } > > > > > > > > -static int dbgfs_register(struct mei_wdt *wdt) > > > > +static void dbgfs_register(struct mei_wdt *wdt) > > > > { > > > > - struct dentry *dir, *f; > > > > + struct dentry *dir; > > > > > > > > dir = debugfs_create_dir(KBUILD_MODNAME, NULL); > > > > - if (!dir) > > > > - return -ENOMEM; > > If create dir fails but the consequent create file succeeds, I would > > guess this will be a mess in the debugs root directory. > > Nope, debugfs_create_dir() can not return NULL, so no files will be created > based on a -ERROR as a parent. > > > Also the tear down won't work as debugfs_remove_recursive will just > > bail out on NULL check. > > Nope, NULL can not be returned from debugfs_create*() functions anymore. > > > Isn't it better just return here, when create_dir fails? > > Nope, no need to :) I see, not a fun of those dirty tricks but I admit it streamlines the code. Ack Thanks Tomas