Skip to content

Commit fdee1b0

Browse files
superm1ij-intel
authored andcommitted
platform/x86: hp-bioscfg: Fix kobject warnings for empty attribute names
The hp-bioscfg driver attempts to register kobjects with empty names when the HP BIOS returns attributes with empty name strings. This causes multiple kernel warnings: kobject: (00000000135fb5e6): attempted to be registered with empty name! WARNING: CPU: 14 PID: 3336 at lib/kobject.c:219 kobject_add_internal+0x2eb/0x310 Add validation in hp_init_bios_buffer_attribute() to check if the attribute name is empty after parsing it from the WMI buffer. If empty, log a debug message and skip registration of that attribute, allowing the module to continue processing other valid attributes. Cc: stable@vger.kernel.org Fixes: a34fc32 ("platform/x86: hp-bioscfg: bioscfg") Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://patch.msgid.link/20260115203725.828434-2-mario.limonciello@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent f7fffd2 commit fdee1b0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <linux/fs.h>
1111
#include <linux/module.h>
1212
#include <linux/kernel.h>
13+
#include <linux/printk.h>
14+
#include <linux/string.h>
1315
#include <linux/wmi.h>
1416
#include "bioscfg.h"
1517
#include "../../firmware_attributes_class.h"
@@ -781,6 +783,12 @@ static int hp_init_bios_buffer_attribute(enum hp_wmi_data_type attr_type,
781783
if (ret < 0)
782784
goto buff_attr_exit;
783785

786+
if (strlen(str) == 0) {
787+
pr_debug("Ignoring attribute with empty name\n");
788+
ret = 0;
789+
goto buff_attr_exit;
790+
}
791+
784792
if (attr_type == HPWMI_PASSWORD_TYPE ||
785793
attr_type == HPWMI_SECURE_PLATFORM_TYPE)
786794
temp_kset = bioscfg_drv.authentication_dir_kset;

0 commit comments

Comments
 (0)