On Wed, Feb 09, 2022 at 11:03:44AM -0800, Stefan Roesch wrote: > + int ret; > + int statx_flags = flags | AT_NO_AUTOMOUNT; > + struct filename *name; > + > + name = getname_flags(filename, getname_statx_lookup_flags(statx_flags), NULL); > + ret = vfs_statx(dfd, name, statx_flags, stat, STATX_BASIC_STATS); > + if (name) > + putname(name); 1) getname and friends return an error as ERR_PTR(-E...), not NULL 2) filename_lookup() et.al. treat ERR_PTR(-E...) as "fail with -E..." 3) putname(ERR_PTR(-E...)) is a no-op. IOW, that if (name) putname(name); is unidiomatic and misleading.