On Tue, Dec 10, 2024 at 12:02:21PM -0500, James Bottomley wrote: > Instead of searching the variable entry list for a variable, use the > dcache lookup functions to find it instead. Also add an efivarfs_ > prefix to the function now it is no longer static. > +bool efivarfs_variable_is_present(efi_char16_t *variable_name, > + efi_guid_t *vendor, void *data) > +{ > + char *name = efivar_get_utf8name(variable_name, vendor); > + struct super_block *sb = data; > + struct dentry *dentry; > + struct qstr qstr; > + > + if (!name) > + return true; > + > + qstr.name = name; > + qstr.len = strlen(name); > + dentry = d_hash_and_lookup(sb->s_root, &qstr); > + kfree(name); > + if (dentry) > + dput(dentry); If that ever gets called with efivarfs_valid_name(name, strlen(name)) being false, that's going to oops...