Skip to contentSkip to conversation

platform/x86: hp-bioscfg: Skip empty attribute names

PATCH In review Mario Limonciello 2 participants 2 messages Jan 28 – Jan 29

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: hp-bioscfg: Skip empty attribute names

Avoid registering kobjects with empty names when a BIOS attribute name decodes to an empty string.

---
 drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +5 -0
index dbe096eefa758..51e8977d3eb4a 100644
@@ -696,6 +696,11 @@ static int hp_init_bios_package_attribute(enum hp_wmi_data_type attr_type,
 		return ret;
 	}
 
+	if (!str_value || !str_value[0]) {
+		pr_debug("Ignoring attribute with empty name\n");
+		goto pack_attr_exit;
+	}
+
 	/* All duplicate attributes found are ignored */
 	duplicate = kset_find_obj(temp_kset, str_value);
 	if (duplicate) {
Signature · 1 line
2.52.0
maintainer
#1 lore raw
Quoted 4 lines · Mario Limonciello

Avoid registering kobjects with empty names when a BIOS attribute name decodes to an empty string.

Thank you for your contribution, it has been applied to my local review-ilpo-fixes branch. Note it will show up in the public platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: hp-bioscfg: Skip empty attribute names

      commit: 6222883af286e2feb3c9ff2bf9fd8fdf4220c55a

--
i.