From: Dan Carpenter Date: Tue, 18 Jul 2023 07:06:26 +0000 (+0300) Subject: platform/x86: hp-bioscfg: fix error reporting in hp_add_other_attributes() X-Git-Tag: v6.6.17~4040^2~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4e695c016e0d5e15e91c7570ac4eef401b5c771;p=platform%2Fkernel%2Flinux-rpi.git platform/x86: hp-bioscfg: fix error reporting in hp_add_other_attributes() Return a negative error code instead of returning success. Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/138641cc-52c0-41a5-8176-ad01c7e28c67@moroto.mountain Reviewed-by: Jorge Lopez Signed-off-by: Hans de Goede --- diff --git a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c index 32d9c36ca553..8c4f9e12f018 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +++ b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c @@ -630,13 +630,18 @@ static int hp_add_other_attributes(int attr_type) switch (attr_type) { case HPWMI_SECURE_PLATFORM_TYPE: ret = hp_populate_secure_platform_data(attr_name_kobj); + if (ret) + goto err_other_attr_init; break; case HPWMI_SURE_START_TYPE: ret = hp_populate_sure_start_data(attr_name_kobj); + if (ret) + goto err_other_attr_init; break; default: + ret = -EINVAL; goto err_other_attr_init; }