diff mbox series

[3/3] platform/x86: hp-bioscfg: fix error reporting in hp_add_other_attributes()

Message ID 138641cc-52c0-41a5-8176-ad01c7e28c67@moroto.mountain (mailing list archive)
State Accepted, archived
Headers show
Series [1/3] platform/x86: hp-bioscfg: fix a signedness bug in hp_wmi_perform_query() | expand

Commit Message

Dan Carpenter July 18, 2023, 7:06 a.m. UTC
Return a negative error code instead of returning success.

Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Lopez, Jorge A (Security) July 25, 2023, 7:35 p.m. UTC | #1
Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com>


Regards,

Jorge Lopez
HP Inc

"Once you stop learning, you start dying"
Albert Einstein

> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@linaro.org>
> Sent: Tuesday, July 18, 2023 2:06 AM
> To: Lopez, Jorge A (Security) <jorge.lopez2@hp.com>
> Cc: Hans de Goede <hdegoede@redhat.com>; Mark Gross
> <markgross@kernel.org>; Thomas Weißschuh <linux@weissschuh.net>;
> platform-driver-x86@vger.kernel.org; kernel-janitors@vger.kernel.org
> Subject: [PATCH 3/3] platform/x86: hp-bioscfg: fix error reporting in
> hp_add_other_attributes()
> 
> CAUTION: External Email
> 
> Return a negative error code instead of returning success.
> 
> Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> 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;
>         }
> 
> --
> 2.39.2
diff mbox series

Patch

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;
 	}