platform/x86: hp-bioscfg: Fix another memory leaks in hp_populate_enumeration_elements_from_package()
Commit Message
If the check that both expected and read object type match fails, some
resource may still need to be released.
Add the missing kfree().
Fixes: 6b2770bfd6f9 ("platform/x86: hp-bioscfg: enum-attributes")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
/!\ Speculative /!\
This patch is based on analysis of the surrounding code and should be
reviewed with care !
/!\ Speculative /!\
---
drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 1 +
1 file changed, 1 insertion(+)
@@ -164,6 +164,7 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum
if (expected_enum_types[eloc] != enum_obj[elem].type) {
pr_err("Error expected type %d for elem %d, but got type %d instead\n",
expected_enum_types[eloc], elem, enum_obj[elem].type);
+ kfree(str_value);
return -EIO;
}