Skip to content

Commit 6222883

Browse files
superm1ij-intel
authored andcommitted
platform/x86: hp-bioscfg: Skip empty attribute names
Avoid registering kobjects with empty names when a BIOS attribute name decodes to an empty string. Fixes: a34fc32 ("platform/x86: hp-bioscfg: bioscfg") Reported-by: Alain Cousinie <[email protected]> Closes: https://lore.kernel.org/platform-driver-x86/[email protected]/ Signed-off-by: Mario Limonciello <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent fe747d7 commit 6222883

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/platform/x86/hp/hp-bioscfg/bioscfg.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,11 @@ static int hp_init_bios_package_attribute(enum hp_wmi_data_type attr_type,
696696
return ret;
697697
}
698698

699+
if (!str_value || !str_value[0]) {
700+
pr_debug("Ignoring attribute with empty name\n");
701+
goto pack_attr_exit;
702+
}
703+
699704
/* All duplicate attributes found are ignored */
700705
duplicate = kset_find_obj(temp_kset, str_value);
701706
if (duplicate) {

0 commit comments

Comments
 (0)