From patchwork Mon Jul 31 20:31:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Lopez X-Patchwork-Id: 13335422 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 203A4C04A94 for ; Mon, 31 Jul 2023 20:32:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230297AbjGaUcQ (ORCPT ); Mon, 31 Jul 2023 16:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjGaUcO (ORCPT ); Mon, 31 Jul 2023 16:32:14 -0400 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6A781BC7; Mon, 31 Jul 2023 13:31:44 -0700 (PDT) Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6bcae8c4072so279638a34.1; Mon, 31 Jul 2023 13:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690835504; x=1691440304; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=4GP+QHr3v6YWcRgxlfip67FR17AcusTOb3sQ59TeLes=; b=a6zaTRTtVtOJGm5dMouMX5i4dPC28dGaiT8x52Ml+aIdH92kRm+oD/GQTktUeTvTl0 o0L3DL9Sj6iOvAXtZYy0p/YTvJxLFkBo+3mngG6g0VhSWTmQcUTDF6+rUVIYLyYBzE6h 5URmUzwMlDnUS1jZBsX25HR9C+S/VxNuIxYlXBKZw63gFOb9ZUaqIlPdMVAKCTT58f/6 Lh/HJegyEZIhvAZ2ZQekxXMvl3fmQnHhen9YMEJ91loXf6kzG7UHxg9WHFUAxe+Nhbtc JNhkaYNnupK1vqf0aCwlfGhJZ9945FnSMm5HHro5GYUycVGy+/5MCvnCMtvMIbu+pdCU dqnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690835504; x=1691440304; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4GP+QHr3v6YWcRgxlfip67FR17AcusTOb3sQ59TeLes=; b=g6irYjT8N7hYHQWMvj9quG6AQpj0P5Xfh0qSgvGfq0pxb1JLshbQPX/aEY+68h4kU1 OjpWdPMcvPVrv75ikegiiW7mx/55w39vFS5slefmt9aUgftsIaGnafxkg+qUF+ftSJNy jHybwxBxLqfHGVV1C0aB3M9x7qzYId577rqUnvaWphnlfoU46FYBo5ZzPlbmWlYvlmZ6 vGL61TrJAzh9YdVDrx6UlqRs0ai7jBkJdrBjTs9+M4qKqa5+3Exts+62322QKvbEJno0 UK2qRPGfj+I6SrTDpuMhXwrS6WyXkc5GOaboL56SGydbTEXg6aOKDOt7tOzN07stY0j7 olbQ== X-Gm-Message-State: ABy/qLYswtA06NrXKTByc8UaMEt3BQPix6HowbodpOxziWjL7oijguy/ FAtkBIe6oCh4ckwIkqa+udY= X-Google-Smtp-Source: APBJJlHTbh+n8V87LrTHRfig+cHWlgJGEbBm3NayJSVS04LYqN74Hqsv+rg8uB07499qPPxheeFM3g== X-Received: by 2002:a9d:7748:0:b0:6b9:1bfa:9e2d with SMTP id t8-20020a9d7748000000b006b91bfa9e2dmr10137742otl.0.1690835504093; Mon, 31 Jul 2023 13:31:44 -0700 (PDT) Received: from grumpy-VECTOR.hsd1.tx.comcast.net ([2601:2c3:480:7390:b620:ce9:47eb:26ab]) by smtp.gmail.com with ESMTPSA id g8-20020a9d6208000000b006b9848f8aa7sm4498841otj.45.2023.07.31.13.31.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 13:31:43 -0700 (PDT) From: Jorge Lopez X-Google-Original-From: Jorge Lopez To: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, thomas@t-8ch.de, ilpo.jarvinen@linux.intel.com, dan.carpenter@linaro.org Subject: [PATCH 1/8] hp-bioscfg: Fix memory leaks in attribute packages Date: Mon, 31 Jul 2023 15:31:34 -0500 Message-Id: <20230731203141.30044-2-jorge.lopez2@hp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230731203141.30044-1-jorge.lopez2@hp.com> References: <20230731203141.30044-1-jorge.lopez2@hp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Address memory leaks while handling elements in packages. Signed-off-by: Jorge Lopez --- Based on the latest platform-drivers-x86.git/for-next --- drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 6 ++++++ drivers/platform/x86/hp/hp-bioscfg/int-attributes.c | 5 +++++ .../platform/x86/hp/hp-bioscfg/order-list-attributes.c | 6 ++++++ drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c | 8 ++++++++ drivers/platform/x86/hp/hp-bioscfg/string-attributes.c | 3 +++ 5 files changed, 28 insertions(+) diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c index b1b241f0205a..8e615ccfc9b5 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c @@ -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; } @@ -224,6 +225,7 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum sizeof(enum_data->common.prerequisites[reqs])); kfree(str_value); + str_value = NULL; } break; @@ -275,6 +277,9 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum strscpy(enum_data->possible_values[pos_values], str_value, sizeof(enum_data->possible_values[pos_values])); + + kfree(str_value); + str_value = NULL; } break; default: @@ -283,6 +288,7 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum } kfree(str_value); + str_value = NULL; } exit_enumeration_package: diff --git a/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c index 7364c5ef9ef8..6db2c8ba02a9 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c @@ -179,6 +179,7 @@ static int hp_populate_integer_elements_from_package(union acpi_object *integer_ if (expected_integer_types[eloc] != integer_obj[elem].type) { pr_err("Error expected type %d for elem %d, but got type %d instead\n", expected_integer_types[eloc], elem, integer_obj[elem].type); + kfree(str_value); return -EIO; } /* Assign appropriate element value to corresponding field*/ @@ -239,6 +240,7 @@ static int hp_populate_integer_elements_from_package(union acpi_object *integer_ str_value, sizeof(integer_data->common.prerequisites[reqs])); kfree(str_value); + str_value = NULL; } break; @@ -258,6 +260,9 @@ static int hp_populate_integer_elements_from_package(union acpi_object *integer_ pr_warn("Invalid element: %d found in Integer attribute or data may be malformed\n", elem); break; } + + kfree(str_value); + str_value = NULL; } exit_integer_package: kfree(str_value); diff --git a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c index 7e49a8427c06..739998682874 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c @@ -174,6 +174,7 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord if (expected_order_types[eloc] != order_obj[elem].type) { pr_err("Error expected type %d for elem %d, but got type %d instead\n", expected_order_types[eloc], elem, order_obj[elem].type); + kfree(str_value); return -EIO; } @@ -231,6 +232,7 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord sizeof(ordered_list_data->common.prerequisites[reqs])); kfree(str_value); + str_value = NULL; } break; @@ -277,13 +279,17 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord part = strsep(&part_tmp, SEMICOLON_SEP); } + kfree(str_value); + str_value = NULL; break; default: pr_warn("Invalid element: %d found in Ordered_List attribute or data may be malformed\n", elem); break; } kfree(tmpstr); + tmpstr = NULL; kfree(str_value); + str_value = NULL; } exit_list: diff --git a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c index 52e4d346b529..3f7b9fe857f1 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c @@ -264,6 +264,7 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor if (expected_password_types[eloc] != password_obj[elem].type) { pr_err("Error expected type %d for elem %d, but got type %d instead\n", expected_password_types[eloc], elem, password_obj[elem].type); + kfree(str_value); return -EIO; } @@ -318,6 +319,8 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor sizeof(password_data->common.prerequisites[reqs])); kfree(str_value); + str_value = NULL; + } break; case SECURITY_LEVEL: @@ -356,6 +359,8 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor str_value, sizeof(password_data->encodings[pos_values])); kfree(str_value); + str_value = NULL; + } break; case PSWD_IS_SET: @@ -365,6 +370,9 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor pr_warn("Invalid element: %d found in Password attribute or data may be malformed\n", elem); break; } + + kfree(str_value); + str_value = NULL; } exit_package: diff --git a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c index 1b62e372fb9e..c9e124af170e 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c @@ -171,6 +171,7 @@ static int hp_populate_string_elements_from_package(union acpi_object *string_ob if (expected_string_types[eloc] != string_obj[elem].type) { pr_err("Error expected type %d for elem %d, but got type %d instead\n", expected_string_types[eloc], elem, string_obj[elem].type); + kfree(str_value); return -EIO; } @@ -232,6 +233,7 @@ static int hp_populate_string_elements_from_package(union acpi_object *string_ob str_value, sizeof(string_data->common.prerequisites[reqs])); kfree(str_value); + str_value = NULL; } break; @@ -250,6 +252,7 @@ static int hp_populate_string_elements_from_package(union acpi_object *string_ob } kfree(str_value); + str_value = NULL; } exit_string_package: From patchwork Mon Jul 31 20:31:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Lopez X-Patchwork-Id: 13335423 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34EF7C04E69 for ; Mon, 31 Jul 2023 20:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230443AbjGaUcQ (ORCPT ); Mon, 31 Jul 2023 16:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbjGaUcP (ORCPT ); Mon, 31 Jul 2023 16:32:15 -0400 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 041D71FE4; Mon, 31 Jul 2023 13:31:45 -0700 (PDT) Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-6bc9efb5091so991272a34.1; Mon, 31 Jul 2023 13:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690835505; x=1691440305; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6etgdLhlCvwrN3XxAkq8IgBOAz9g8chc4g8ku19/Um8=; b=lAOKnEYr51S+mk8Cn85+E8N3t8/zWUaA4tcAilXB3LQ0tKtlsv2eMub1UlsnUHuM3L jq9pdYcmxwZdjiuNWPgpDZDYphyc4Xf90Xj1kG+BweGOcwV56rjpp102t/8VLEuz/6B5 5aFRbjhJSX1bQ00o2QYCqhDbEMTei/IeCLt3zTqbv+SRmNKrRjFyEynBcGuBKBK5jXWZ ANt8+rm/8mzYHabh5JMYySgLDHKIOHAXekGsjt0ApsOTtzt1kc8L5m7bqdnassNgHfOU ZVcNOYMNg82UnaCMM58jV2pWn/C47MFK6KDbKklqd3UzsOD15xOLPyvQNofTvMccIb7B WSmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690835505; x=1691440305; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6etgdLhlCvwrN3XxAkq8IgBOAz9g8chc4g8ku19/Um8=; b=HsEBOgwzDbTrqzW4SFeUvMTqYipYRk9h29bRADwHqyoK6Ede6FtmDZNkMdUU3Fbwlk bCGfEvEAEEV/RfSvHSuBYZq7ZxD5TKbMXJmGJTIVmvrAaPQJWpaXOjnUpPCKyFz2O0fw lc5l/JAP93hOjBpcOk+udUiNE9Sp6JHiIJlVE1+IU6+R9XImK+8h3WdKfQtGYJSDfp20 HnGzRD//3e5VzsVYNvHLbyLdVekEqHM9rx9D+o96G6D1K/smxMecA08HlTZmsG4MSusP XptaWGN2RsmndnXPqBY2fvBYPbelcCZGu2YdQQtbMAdSf8aSc2Afhs1bP43giZAv1Gv1 H3JQ== X-Gm-Message-State: ABy/qLZq8NZQQySW+CIpkuvH+hnIS03ch5TLaT8kUMG4p21VYPzFaYBJ nx5H9nxjeDvjbcn4nICpVls= X-Google-Smtp-Source: APBJJlFArQcIw8leDIvWHellOjfCxDxrNkOqjoe5lrrEZDh2X/twXbk7wXOWAdM0lullVdpngDGJ9w== X-Received: by 2002:a05:6830:102:b0:6b9:cfc3:65d1 with SMTP id i2-20020a056830010200b006b9cfc365d1mr9518433otp.17.1690835505296; Mon, 31 Jul 2023 13:31:45 -0700 (PDT) Received: from grumpy-VECTOR.hsd1.tx.comcast.net ([2601:2c3:480:7390:b620:ce9:47eb:26ab]) by smtp.gmail.com with ESMTPSA id g8-20020a9d6208000000b006b9848f8aa7sm4498841otj.45.2023.07.31.13.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 13:31:45 -0700 (PDT) From: Jorge Lopez X-Google-Original-From: Jorge Lopez To: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, thomas@t-8ch.de, ilpo.jarvinen@linux.intel.com, dan.carpenter@linaro.org Subject: [PATCH 2/8] hp-bioscfg: Fix uninitialized variable errors Date: Mon, 31 Jul 2023 15:31:35 -0500 Message-Id: <20230731203141.30044-3-jorge.lopez2@hp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230731203141.30044-1-jorge.lopez2@hp.com> References: <20230731203141.30044-1-jorge.lopez2@hp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Fix uninitialized variable errors. Signed-off-by: Jorge Lopez --- Based on the latest platform-drivers-x86.git/for-next --- drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 2 +- drivers/platform/x86/hp/hp-bioscfg/int-attributes.c | 2 +- drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c | 4 ++-- drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c | 2 +- drivers/platform/x86/hp/hp-bioscfg/string-attributes.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c index 8e615ccfc9b5..7f77963cd7fa 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c @@ -129,7 +129,7 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum char *str_value = NULL; int value_len; u32 size = 0; - u32 int_value; + u32 int_value = 0; int elem = 0; int reqs; int pos_values; diff --git a/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c index 6db2c8ba02a9..97f88e0ef0cc 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c @@ -143,7 +143,7 @@ static int hp_populate_integer_elements_from_package(union acpi_object *integer_ char *str_value = NULL; int value_len; int ret; - u32 int_value; + u32 int_value = 0; int elem; int reqs; int eloc; diff --git a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c index 739998682874..89e67db733eb 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c @@ -131,10 +131,10 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord int instance_id) { char *str_value = NULL; - int value_len; + int value_len = 0; int ret; u32 size; - u32 int_value; + u32 int_value = 0; int elem; int reqs; int eloc; diff --git a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c index 3f7b9fe857f1..5e833ea0c5e3 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c @@ -227,7 +227,7 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor int value_len; int ret; u32 size; - u32 int_value; + u32 int_value = 0; int elem; int reqs; int eloc; diff --git a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c index c9e124af170e..e0ecdfca4def 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c @@ -133,7 +133,7 @@ static int hp_populate_string_elements_from_package(union acpi_object *string_ob char *str_value = NULL; int value_len; int ret = 0; - u32 int_value; + u32 int_value = 0; int elem; int reqs; int eloc; From patchwork Mon Jul 31 20:31:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Lopez X-Patchwork-Id: 13335425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BAE6C04FE0 for ; Mon, 31 Jul 2023 20:32:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230459AbjGaUcR (ORCPT ); Mon, 31 Jul 2023 16:32:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230461AbjGaUcQ (ORCPT ); Mon, 31 Jul 2023 16:32:16 -0400 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 390211FE8; Mon, 31 Jul 2023 13:31:47 -0700 (PDT) Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6b9ec15e014so4511775a34.0; Mon, 31 Jul 2023 13:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690835506; x=1691440306; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=z4r7hlXWseUPS8Ohu6FpUF1/8b6j8vCToVBA5O29jC0=; b=ilsHLKr9sXxSN9KO6o8w+5ZAiMMnrUHolPSXvNFQZ4kHdhuiI8oLlVqrEY7z8H/vwW y3Ps6IJb3FQoWySEGwbMJQlSCYvs258SBRtYu6Cb6dkZmjXpQkPeVlnWsosLQKKt8rSS Phhcj/xSaycVl5DEh3I06JUH/n0pb1yv/9MEahgxDq21E0tkL/VruGpcU947/zctXplW pJb2SFwtU6/YQtveBZqtW2jlN+loZWIFOga7LP9hJ5kTjgTmMa88R7/zZHu2H7CVhFye uywxjqI3Acdsa5M394ls7uZkL1vLXNpunpGGOe3MRlN2G49m9DgSeL1vJY+JOFbZmjXT gYaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690835506; x=1691440306; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z4r7hlXWseUPS8Ohu6FpUF1/8b6j8vCToVBA5O29jC0=; b=RPsklGatqp6f7eb1uYOHnct/5fAmqi0TDEVZ6l3grSghGF5u7d6VWkdotZ2ec5i6Jx +/lqXU1DDvgW2o+JLkIfiTIkx+b/ot3f5U9f+boOFMKFrV4nPheCIdPgBlIeBXML8f1c VjBRpNQDI89S8oWZoYkwXhiH1F8XlKf5xLwTgcUSaOoNnbAgoAOhcXimqAx2jklwyOoG LC4wmV5atquKefL9ly1ND2JZsgm5iV6K3fe2cHO13DMacOdqTQ+/iPY5gcM/64cEzl8d eNkKxRc7hZ+5cp+lZrN5wducuZ5jvVp5m3FgPL+WAk51Hy2CUyXanKxtS5rV8l3ZmlIH 1Z1w== X-Gm-Message-State: ABy/qLYLmtlXNVRQ6PNRsNuoDOR0EXOVhtgChs/8RXRDO7WRS+Y1QD82 Bk0BqD8iUZy81bzQoQijCd0= X-Google-Smtp-Source: APBJJlH+HQj0Mdp7320TlY6ZA7Iv7YdYb2t06bJ2204C073Npiwf0EEZ/FEKseBOu+iSsTuQHYvbrg== X-Received: by 2002:a9d:6205:0:b0:6af:9b42:9794 with SMTP id g5-20020a9d6205000000b006af9b429794mr11087047otj.35.1690835506544; Mon, 31 Jul 2023 13:31:46 -0700 (PDT) Received: from grumpy-VECTOR.hsd1.tx.comcast.net ([2601:2c3:480:7390:b620:ce9:47eb:26ab]) by smtp.gmail.com with ESMTPSA id g8-20020a9d6208000000b006b9848f8aa7sm4498841otj.45.2023.07.31.13.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 13:31:46 -0700 (PDT) From: Jorge Lopez X-Google-Original-From: Jorge Lopez To: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, thomas@t-8ch.de, ilpo.jarvinen@linux.intel.com, dan.carpenter@linaro.org Subject: [PATCH 3/8] hp-bioscfg: Replace the word HACK from source code Date: Mon, 31 Jul 2023 15:31:36 -0500 Message-Id: <20230731203141.30044-4-jorge.lopez2@hp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230731203141.30044-1-jorge.lopez2@hp.com> References: <20230731203141.30044-1-jorge.lopez2@hp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Replace the word 'HACK' with 'step' from source code Signed-off-by: Jorge Lopez --- Based on the latest platform-drivers-x86.git/for-next --- drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 4 ++-- drivers/platform/x86/hp/hp-bioscfg/int-attributes.c | 2 +- drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c | 4 ++-- drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c | 4 ++-- drivers/platform/x86/hp/hp-bioscfg/string-attributes.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c index 7f77963cd7fa..50855ff48926 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c @@ -195,7 +195,7 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n"); /* - * This HACK is needed to keep the expected + * This step is needed to keep the expected * element list pointing to the right obj[elem].type * when the size is zero. PREREQUISITES * object is omitted by BIOS when the size is @@ -243,7 +243,7 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum pr_warn("Possible number values size value exceeded the maximum number of elements supported or data may be malformed\n"); /* - * This HACK is needed to keep the expected + * This step is needed to keep the expected * element list pointing to the right obj[elem].type * when the size is zero. POSSIBLE_VALUES * object is omitted by BIOS when the size is zero. diff --git a/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c index 97f88e0ef0cc..a45919616fa8 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c @@ -211,7 +211,7 @@ static int hp_populate_integer_elements_from_package(union acpi_object *integer_ if (integer_data->common.prerequisites_size > MAX_PREREQUISITES_SIZE) pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n"); /* - * This HACK is needed to keep the expected + * This step is needed to keep the expected * element list pointing to the right obj[elem].type * when the size is zero. PREREQUISITES * object is omitted by BIOS when the size is diff --git a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c index 89e67db733eb..aba7d26b54b2 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c @@ -207,7 +207,7 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n"); /* - * This HACK is needed to keep the expected + * This step is needed to keep the expected * element list pointing to the right obj[elem].type * when the size is zero. PREREQUISITES * object is omitted by BIOS when the size is @@ -245,7 +245,7 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord if (int_value > MAX_ELEMENTS_SIZE) pr_warn("Ordered List size value exceeded the maximum number of elements supported or data may be malformed\n"); /* - * This HACK is needed to keep the expected + * This step is needed to keep the expected * element list pointing to the right obj[elem].type * when the size is zero. ORD_LIST_ELEMENTS * object is omitted by BIOS when the size is diff --git a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c index 5e833ea0c5e3..3840380a5aee 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c @@ -293,7 +293,7 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor if (int_value > MAX_PREREQUISITES_SIZE) pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n"); - /* This HACK is needed to keep the expected + /* This step is needed to keep the expected * element list pointing to the right obj[elem].type * when the size is zero. PREREQUISITES * object is omitted by BIOS when the size is @@ -337,7 +337,7 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor if (int_value > MAX_ENCODINGS_SIZE) pr_warn("Password Encoding size value exceeded the maximum number of elements supported or data may be malformed\n"); - /* This HACK is needed to keep the expected + /* This step is needed to keep the expected * element list pointing to the right obj[elem].type * when the size is zero. PSWD_ENCODINGS * object is omitted by BIOS when the size is diff --git a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c index e0ecdfca4def..378cedb502ba 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c @@ -203,7 +203,7 @@ static int hp_populate_string_elements_from_package(union acpi_object *string_ob if (string_data->common.prerequisites_size > MAX_PREREQUISITES_SIZE) pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n"); /* - * This HACK is needed to keep the expected + * This step is needed to keep the expected * element list pointing to the right obj[elem].type * when the size is zero. PREREQUISITES * object is omitted by BIOS when the size is From patchwork Mon Jul 31 20:31:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Lopez X-Patchwork-Id: 13335426 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38398C04A94 for ; Mon, 31 Jul 2023 20:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231139AbjGaUcU (ORCPT ); Mon, 31 Jul 2023 16:32:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbjGaUcR (ORCPT ); Mon, 31 Jul 2023 16:32:17 -0400 Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A34011FEB; Mon, 31 Jul 2023 13:31:48 -0700 (PDT) Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1bb7e083783so3707548fac.2; Mon, 31 Jul 2023 13:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690835508; x=1691440308; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ORy/KirT4m+ce+uPY5vqyS0RMXRRbr7WlzIIEULMUow=; b=WYA8s/QPa85xHYmyaaGiwjLDzCAo4e0uyYvL/OeQt34wS9QzEoSRJuUourNruAhFik hiVENS3p/FRMXySvzt6QJ+4TC9YZ6oef3RkyHX4E9e1aNYHSy8heb7I/M7m2AzM9tQ5a F/cATPfYA3UeW83SNDgNd5mN9TKJACbvr3kCYZJJlISkuIo54GCcyobKIf+vdof85oP7 9ezD//amjdVtY5+m7RR0f8spxSqdtPpmRaMZ51hL1ClPQvw/wastwQChIe9oiGz/NvxM fmSIhzQh/alYHw5NYy5uhuc/nvwlldd6+e0Bmc3rNyXfRZ06qSNgFF5JHeDl54gSBGEe 2jXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690835508; x=1691440308; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ORy/KirT4m+ce+uPY5vqyS0RMXRRbr7WlzIIEULMUow=; b=WhZ4qESHqgXWCiVQtHphRFflvZ2SWTyDq+sIKglVn1F+C03Ng463sQnyJV4l9yRiTe 6J4nxKIsyy3j2Ma8ePaQpz6Sss/edUGNwZqaLFMXrLUigoC9lVPn8F/BKlHyruqhhwTK oPw23vNu6ZV52WN+2L2iVlpE75rNkYbh9QbI1xTKm38dwKU6bVRGdkdTJpK7+k8OhE/E CPCzV7c24pQgBYg/kQtjvvrg5l0w5vrAvI+h/I/a9+DjTvp5hgHyiGzKW3/SOuF6B+/r dulWTJm2+Y1WscrNnRziYbahCphr6vJeUsNK5TykeWfnuUsL5vjTeo8Yu/JsifAe3bZg 0mAw== X-Gm-Message-State: ABy/qLbT6pz6YTfG84WHgI0AjdWkcTYHPwEuU8us8ETF/kPcRcC9XWf5 pRlwRZ3zz/4LvY9wVckG63Q= X-Google-Smtp-Source: APBJJlHXTILjlNjNxHIVxPcF7LxCfNItSbegA28vbBrEtBP+32azg5wRY3OQyB71B7fo9dSVpqPX3Q== X-Received: by 2002:a05:6870:4394:b0:1b0:222f:9cda with SMTP id r20-20020a056870439400b001b0222f9cdamr12716459oah.0.1690835507769; Mon, 31 Jul 2023 13:31:47 -0700 (PDT) Received: from grumpy-VECTOR.hsd1.tx.comcast.net ([2601:2c3:480:7390:b620:ce9:47eb:26ab]) by smtp.gmail.com with ESMTPSA id g8-20020a9d6208000000b006b9848f8aa7sm4498841otj.45.2023.07.31.13.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 13:31:47 -0700 (PDT) From: Jorge Lopez X-Google-Original-From: Jorge Lopez To: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, thomas@t-8ch.de, ilpo.jarvinen@linux.intel.com, dan.carpenter@linaro.org Subject: [PATCH 4/8] hp-bioscfg: Change how prerequisites size is evaluated Date: Mon, 31 Jul 2023 15:31:37 -0500 Message-Id: <20230731203141.30044-5-jorge.lopez2@hp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230731203141.30044-1-jorge.lopez2@hp.com> References: <20230731203141.30044-1-jorge.lopez2@hp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Update steps taken to evaluate prerequisites size value Signed-off-by: Jorge Lopez --- Based on the latest platform-drivers-x86.git/for-next --- drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 6 ++++-- drivers/platform/x86/hp/hp-bioscfg/int-attributes.c | 6 +++++- drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c | 6 ++++-- drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c | 6 ++++-- drivers/platform/x86/hp/hp-bioscfg/string-attributes.c | 6 ++++-- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c index 50855ff48926..89bb039a8a3c 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c @@ -190,9 +190,11 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum enum_data->common.sequence = int_value; break; case PREREQUISITES_SIZE: - enum_data->common.prerequisites_size = int_value; - if (int_value > MAX_PREREQUISITES_SIZE) + if (int_value > MAX_PREREQUISITES_SIZE) { pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n"); + int_value = MAX_PREREQUISITES_SIZE; + } + enum_data->common.prerequisites_size = int_value; /* * This step is needed to keep the expected diff --git a/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c index a45919616fa8..86b7ac63fec2 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/int-attributes.c @@ -208,8 +208,12 @@ static int hp_populate_integer_elements_from_package(union acpi_object *integer_ integer_data->common.sequence = int_value; break; case PREREQUISITES_SIZE: - if (integer_data->common.prerequisites_size > MAX_PREREQUISITES_SIZE) + if (int_value > MAX_PREREQUISITES_SIZE) { pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n"); + int_value = MAX_PREREQUISITES_SIZE; + } + integer_data->common.prerequisites_size = int_value; + /* * This step is needed to keep the expected * element list pointing to the right obj[elem].type diff --git a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c index aba7d26b54b2..71f588cbdf88 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c @@ -202,9 +202,11 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord ordered_list_data->common.sequence = int_value; break; case PREREQUISITES_SIZE: - ordered_list_data->common.prerequisites_size = int_value; - if (int_value > MAX_PREREQUISITES_SIZE) + if (int_value > MAX_PREREQUISITES_SIZE) { pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n"); + int_value = MAX_PREREQUISITES_SIZE; + } + ordered_list_data->common.prerequisites_size = int_value; /* * This step is needed to keep the expected diff --git a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c index 3840380a5aee..afb5190afc03 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c @@ -289,9 +289,11 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor password_data->common.sequence = int_value; break; case PREREQUISITES_SIZE: - password_data->common.prerequisites_size = int_value; - if (int_value > MAX_PREREQUISITES_SIZE) + if (int_value > MAX_PREREQUISITES_SIZE) { pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n"); + int_value = MAX_PREREQUISITES_SIZE; + } + password_data->common.prerequisites_size = int_value; /* This step is needed to keep the expected * element list pointing to the right obj[elem].type diff --git a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c index 378cedb502ba..f0c20070094d 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c @@ -198,10 +198,12 @@ static int hp_populate_string_elements_from_package(union acpi_object *string_ob string_data->common.sequence = int_value; break; case PREREQUISITES_SIZE: + if (int_value > MAX_PREREQUISITES_SIZE) { + pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n"); + int_value = MAX_PREREQUISITES_SIZE; + } string_data->common.prerequisites_size = int_value; - if (string_data->common.prerequisites_size > MAX_PREREQUISITES_SIZE) - pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n"); /* * This step is needed to keep the expected * element list pointing to the right obj[elem].type From patchwork Mon Jul 31 20:31:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Lopez X-Patchwork-Id: 13335424 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B49BC001DE for ; Mon, 31 Jul 2023 20:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230481AbjGaUcT (ORCPT ); Mon, 31 Jul 2023 16:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230478AbjGaUcR (ORCPT ); Mon, 31 Jul 2023 16:32:17 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB7101FFA; Mon, 31 Jul 2023 13:31:49 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6bc9de53ee2so1112135a34.2; Mon, 31 Jul 2023 13:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690835509; x=1691440309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=TwRSmfU6RJWP4ZN9Da8lv+MVwRca/bs+SmazkO+4OqA=; b=Jyhx/7DtIEcu4CsTRBgHUv3ubhTc9rMPIj/ph+21A9SsjaNzhIKUQ4ZQUeSUvyuEBh 9eRuwL+5CrTelz7Gw929iORd8Swi3j5ZgHRliUZcsaXwtC1Od3uJWZt8uWx+XSDsBVtI cYGnsAyj+Xc/gcD49RJ9B0YMq/cvIJRVB7tgnGW/5RbKQsgFRv+iufdgNadXdLhhKDic w71VxohNoe5olylTYg4a80D7WXZ+oHYs1NA3G9lqDm2PrDdo1rojKVn78BnLJbmzuibm 6SYp97tkIx3Mu/nDiyEWs8In7f95wpSxveUtCUznT53fAD3x8r0MYk9/k/ecDNG6BOFP lqzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690835509; x=1691440309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TwRSmfU6RJWP4ZN9Da8lv+MVwRca/bs+SmazkO+4OqA=; b=dv2Lcr4EJAFhlUniQP4k2repEFSZHmFePb8x8167Fw/9A9cm9aICSlzhv0w2Mm3r77 4kqtd4UXap9+ETfrGVhRbveUqSGBPeWZpPw4ENvhk8Kzgf0fkZQjRgvF+fxeu3ROMV35 +bP3R3Yo12PNhpyFV69ickxwF1KsmVLwEQ8df3QM5HSz7DZniyH9qvPzHT5NUm/5BveY DeMYEWSaX+IVJSe6XQvjV6bPSoWII4q7Ltp3w7BpWS1RF0PSkc8CePutHLpVLCDxo7Be r7aqi02J9L5y3tMcc+lo7pAcHHvomrqB1UqBfyOwmj2fFHJjpXb5L0Bl9GHwU1ZrEHpG +7Xw== X-Gm-Message-State: ABy/qLY1VQNZ4GaGhf2KSPaZmP8also3saOJxoqnPNSGgfB2IS1DHsNI dmA36SSRnzr/bN7pdKs4cJM= X-Google-Smtp-Source: APBJJlETEAJS60DwTtNbNSUOHXYlkWJVgBY6u8u258sPi0mEePE8jWnT8wuWHm/zLy9tbOBErxIfug== X-Received: by 2002:a9d:75d5:0:b0:6b9:cf84:8cdd with SMTP id c21-20020a9d75d5000000b006b9cf848cddmr9544789otl.24.1690835509105; Mon, 31 Jul 2023 13:31:49 -0700 (PDT) Received: from grumpy-VECTOR.hsd1.tx.comcast.net ([2601:2c3:480:7390:b620:ce9:47eb:26ab]) by smtp.gmail.com with ESMTPSA id g8-20020a9d6208000000b006b9848f8aa7sm4498841otj.45.2023.07.31.13.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 13:31:48 -0700 (PDT) From: Jorge Lopez X-Google-Original-From: Jorge Lopez To: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, thomas@t-8ch.de, ilpo.jarvinen@linux.intel.com, dan.carpenter@linaro.org Subject: [PATCH 5/8] hp-bioscfg: Change how order list size is evaluated Date: Mon, 31 Jul 2023 15:31:38 -0500 Message-Id: <20230731203141.30044-6-jorge.lopez2@hp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230731203141.30044-1-jorge.lopez2@hp.com> References: <20230731203141.30044-1-jorge.lopez2@hp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Update steps how order list size is evaluated Signed-off-by: Jorge Lopez --- Based on the latest platform-drivers-x86.git/for-next --- drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c index 71f588cbdf88..3b073910b430 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c @@ -243,9 +243,12 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord break; case ORD_LIST_SIZE: + if (int_value > MAX_ELEMENTS_SIZE) { + pr_warn("Order List size value exceeded the maximum number of elements supported or data may be malformed\n"); + int_value = MAX_ELEMENTS_SIZE; + } ordered_list_data->elements_size = int_value; - if (int_value > MAX_ELEMENTS_SIZE) - pr_warn("Ordered List size value exceeded the maximum number of elements supported or data may be malformed\n"); + /* * This step is needed to keep the expected * element list pointing to the right obj[elem].type From patchwork Mon Jul 31 20:31:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Lopez X-Patchwork-Id: 13335427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99224C04E69 for ; Mon, 31 Jul 2023 20:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231146AbjGaUcU (ORCPT ); Mon, 31 Jul 2023 16:32:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230063AbjGaUcR (ORCPT ); Mon, 31 Jul 2023 16:32:17 -0400 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE47119B4; Mon, 31 Jul 2023 13:31:50 -0700 (PDT) Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6b9c57c4d12so3757709a34.1; Mon, 31 Jul 2023 13:31:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690835510; x=1691440310; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Na7ZXn3NbUlQQiPPzn9VAvAq8FAlzQ7CZv0qwkxXlmo=; b=M5ryLPwEvh+tZico/g2DswMCiZKOJqgZUn0VDE/u6wkceQk6IzMM04Pj5fuCedd9NE IPSSog8CCvRJ2dhhq8sVjJQBFrct1EsOwzcLyOv7/hRnGSbZDsLOLVSf3GdKk5sO7S+e TM4ffThJ3NCje0rljIfHTYpwZzzlLsnb105UDXo7PYM3PXebgO6LCkDcJnwSQNSrwRo4 Jw6FfpxUX+FgQD2lWqYX5bXiEcQlp8hYKNp3XDVqwlvZ+FRgXJ3BbavmUCPT72qmTjgR gT5l5nYPxQMHmtmKK5zW7vbqfwVQ1mdXhDSMMnpm4ObT0JRh96Rz4ML5bHI06YE+vaeE 1Qiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690835510; x=1691440310; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Na7ZXn3NbUlQQiPPzn9VAvAq8FAlzQ7CZv0qwkxXlmo=; b=fUxfac3znboNfOdaRCkPZ2agKqKh0e7OM3ayf7bi3z1BEGaWhnkN5J0zc7+9MEXusn OHqVf5hdHuAMXk2+hmalAyst6E/BBq2NJMTJIqTHaN3kzifbeqAgCYXHjlVvtkaj2Emg eM50GxkFu3dkEb/gYsf20biUMH8tSUify1enIMGluE5W4Gjtge6+0VQEY1skJB9CBFFk PIhqCVPsXR1Wnk2aZie7GKEuehYbMqZYEt8wPID13XbJwdk5QZfW3OG+Hyvul9VcymwG 5lDdjLdRKKUaFzrbXaYJO7L0zn0/MDU7cCF+wryAqFhzzVm2YI7IC7uj2Ggyh4cSWzAf 9URQ== X-Gm-Message-State: ABy/qLaZd/JkNyWT118NwEOatGxWHo0ifJ6EPFb/di/JBHazCGnhta3O AP9T0T/2Rc7TIbGb9jY0HRE= X-Google-Smtp-Source: APBJJlFnAThtuO3s4qVIVIUJznIanPNQbnQYw1D0yxMPo+qqh52yOZmn4XpA9B3kiS8KMCAE4sBqYw== X-Received: by 2002:a9d:6b84:0:b0:6b9:da1f:653f with SMTP id b4-20020a9d6b84000000b006b9da1f653fmr11929168otq.21.1690835510242; Mon, 31 Jul 2023 13:31:50 -0700 (PDT) Received: from grumpy-VECTOR.hsd1.tx.comcast.net ([2601:2c3:480:7390:b620:ce9:47eb:26ab]) by smtp.gmail.com with ESMTPSA id g8-20020a9d6208000000b006b9848f8aa7sm4498841otj.45.2023.07.31.13.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 13:31:49 -0700 (PDT) From: Jorge Lopez X-Google-Original-From: Jorge Lopez To: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, thomas@t-8ch.de, ilpo.jarvinen@linux.intel.com, dan.carpenter@linaro.org Subject: [PATCH 6/8] hp-bioscfg: Change how enum possible values size is evaluated Date: Mon, 31 Jul 2023 15:31:39 -0500 Message-Id: <20230731203141.30044-7-jorge.lopez2@hp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230731203141.30044-1-jorge.lopez2@hp.com> References: <20230731203141.30044-1-jorge.lopez2@hp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Updates steps how enum possible values size is evaluated Signed-off-by: Jorge Lopez --- Based on the latest platform-drivers-x86.git/for-next --- drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c index 89bb039a8a3c..a2402d31c146 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c @@ -240,9 +240,11 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum str_value, sizeof(enum_data->current_value)); break; case ENUM_SIZE: - enum_data->possible_values_size = int_value; - if (int_value > MAX_VALUES_SIZE) + if (int_value > MAX_VALUES_SIZE) { pr_warn("Possible number values size value exceeded the maximum number of elements supported or data may be malformed\n"); + int_value = MAX_VALUES_SIZE; + } + enum_data->possible_values_size = int_value; /* * This step is needed to keep the expected From patchwork Mon Jul 31 20:31:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Lopez X-Patchwork-Id: 13335429 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2D37C001DE for ; Mon, 31 Jul 2023 20:32:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbjGaUcW (ORCPT ); Mon, 31 Jul 2023 16:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230482AbjGaUcR (ORCPT ); Mon, 31 Jul 2023 16:32:17 -0400 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D67C01BD6; Mon, 31 Jul 2023 13:31:51 -0700 (PDT) Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6b9d68a7abaso3744029a34.3; Mon, 31 Jul 2023 13:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690835511; x=1691440311; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=jPT0ddPruGbkg3FYrX/+sMXt1fqGYVBPjdmYjXOpwng=; b=T72sl30lZTgWUIckxBk/IGYjIAUiJ4EGYkG5sgd/0IDTZpcmuEgl1qgk9isgNR5W4r 3JF9mE87/OMoIuvM1UyrlOdyS5Gvh+gL3m5Q3MfGnE6yGTnShNTQUhz2/dEL+DBVuzIH eeeetvQ0L2eJM7fn5Uu/JCKEv4ZnZuuKe6/p1OtxjvDnIs1aALppF3u7OnQ2GWHlAHzO +xbrdjopnuah+UMV9mQr86ryH6W+562Z2GM3zlfVy9SuD8QH1rSOsdoV9adwqoKMZlgQ rCMuUgdi4ObC8gbPRWsVTt3mumi6Jd3YtIuappRPy1ZP82pMPfEvqWtkv1/JJMq/Dsox Iv+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690835511; x=1691440311; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jPT0ddPruGbkg3FYrX/+sMXt1fqGYVBPjdmYjXOpwng=; b=Q5tyXe7TRkNhyRv/NHVWMPR3UqMeSR3OXFIwXa5aobRiO+zw7yE5VOnIkwxVUGF5/p 3upEvGiJwm0JZt2cCrdKM5pliieHDaSChOk7ai99csNaTj+BLjyfcpcV+b0j2oP7jdyc wA8IJ6eo/aA/rbz2z1Cl6yv3Myij3/y41UpzhiPofHo3ElDznpYUpzQRCica3ekXUOUE NLLGEvNmLQxW3A50783sl52bK2qKV+juhYrUTFuyRs4rMJ1MDs8ksWBNVrNOirLkQV8n V+E4nv21UycPL9Dq6bb40TavM4UHpyJmWzR/9sASRWS3UnDgLx4kjmKr6qzoh7uKLxew mQ4A== X-Gm-Message-State: ABy/qLa0I/3wvAkiBXVwhAViNoA9PDAt7hcz4F4GChQqUPQfTMixQAUj 2TFi1Tx6AvrrmcrPgCTF57HL/6CgM58= X-Google-Smtp-Source: APBJJlHTO4XtFGrpytumo4uCqourkFjJJJBMBotvl8XdUWgcAJj9LYVYNTjALlKQnXVov9+zdykaNQ== X-Received: by 2002:a05:6830:1e05:b0:6b7:494b:a503 with SMTP id s5-20020a0568301e0500b006b7494ba503mr10143636otr.18.1690835511237; Mon, 31 Jul 2023 13:31:51 -0700 (PDT) Received: from grumpy-VECTOR.hsd1.tx.comcast.net ([2601:2c3:480:7390:b620:ce9:47eb:26ab]) by smtp.gmail.com with ESMTPSA id g8-20020a9d6208000000b006b9848f8aa7sm4498841otj.45.2023.07.31.13.31.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 13:31:50 -0700 (PDT) From: Jorge Lopez X-Google-Original-From: Jorge Lopez To: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, thomas@t-8ch.de, ilpo.jarvinen@linux.intel.com, dan.carpenter@linaro.org Subject: [PATCH 7/8] hp-bioscfg: Change how password encoding size is evaluated Date: Mon, 31 Jul 2023 15:31:40 -0500 Message-Id: <20230731203141.30044-8-jorge.lopez2@hp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230731203141.30044-1-jorge.lopez2@hp.com> References: <20230731203141.30044-1-jorge.lopez2@hp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Update steps how password encoding size is evaluated Signed-off-by: Jorge Lopez --- Based on the latest platform-drivers-x86.git/for-next --- drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c index afb5190afc03..03d0188804ba 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c @@ -335,9 +335,12 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor password_data->max_password_length = int_value; break; case PSWD_SIZE: - password_data->encodings_size = int_value; - if (int_value > MAX_ENCODINGS_SIZE) + + if (int_value > MAX_ENCODINGS_SIZE) { pr_warn("Password Encoding size value exceeded the maximum number of elements supported or data may be malformed\n"); + int_value = MAX_ENCODINGS_SIZE; + } + password_data->encodings_size = int_value; /* This step is needed to keep the expected * element list pointing to the right obj[elem].type From patchwork Mon Jul 31 20:31:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Lopez X-Patchwork-Id: 13335428 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF46EC04FE1 for ; Mon, 31 Jul 2023 20:32:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230469AbjGaUcV (ORCPT ); Mon, 31 Jul 2023 16:32:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230484AbjGaUcS (ORCPT ); Mon, 31 Jul 2023 16:32:18 -0400 Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2911A19BB; Mon, 31 Jul 2023 13:31:53 -0700 (PDT) Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-56ce936f7c0so278361eaf.3; Mon, 31 Jul 2023 13:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690835512; x=1691440312; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=qwFVZbWKnZ7U+byhcxwRklu+51Zv8fYKOqQRjPN+S0Q=; b=rHKy5Xfb1d8QWmHrev+LJ1PSeQlNZGbeZN9MC0Z6bjOUqGrc+yctr6q5VeFP9UZktt X6G76UXB6Y8axtuMJBmwhtkKepZkKm8EAoupm4G72rQVhV5MI45btyVFpkPWXBEJaZ6L NxLWBOR7pDBQntHbJyLy3XCykYT9b0i/9GjrOdgGwJ0oX35ev6w+whrbgUCy0ECQHBES +LVXIVWvPtcaYsf0ICwITYlNzacghadoKYRgNeLgC4LEubYjpFlzCVJyEO73QnV6pREh hg8VjbNJGcaaG6Gfpatgt3Qn0H7g/ijmfAp8HTNw8A/ql3K2zVw6MCOYG5ENvJLvwGM+ /9kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690835512; x=1691440312; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qwFVZbWKnZ7U+byhcxwRklu+51Zv8fYKOqQRjPN+S0Q=; b=hGflPSZG3ExR2YCfmeB4CHL8EvM4OEsO3PWY3/493kZiqPS2CBIsCnoQdo9aPebkou Bmfj90h9XgDqWXfaT8DqCyM7S9B9OKeGFxAf99AIUu+CJBYTTfVK94Haeh1mfFn5IzVj +99P5P/xxKmWLBodelbXPHsQrTHI4Tzmpd+kLosuooSaQJkxwJFo/+UjB+2On0zeu2fz cGikAXpk12S+OF4R3XsK6w9HGcCGmPJN4H4O2tBpP/is1y1mvpyIia3EZXqRU3VTdMIn DLYSQKEinx4VqImuSqdkCOOngClBMk1E4Ge738qm+CexGFNNBP4ONbKXeEdsZYEhOImc 4KBA== X-Gm-Message-State: ABy/qLb9uK2wxTzIudE8SjIp+9vJ9RQ/usv+lhoPiivkaTmZPzgbnqvH bGND1aIaoj6aqehvE5WO/AI= X-Google-Smtp-Source: APBJJlHyfogy7pdQITs3TEK4hodgymCEiISUtPceL4AQG5kDLkR22xJyaa5B6zuDPP8FMeoL3gMzfw== X-Received: by 2002:a05:6870:b28e:b0:1bb:951e:3d61 with SMTP id c14-20020a056870b28e00b001bb951e3d61mr14375891oao.36.1690835512414; Mon, 31 Jul 2023 13:31:52 -0700 (PDT) Received: from grumpy-VECTOR.hsd1.tx.comcast.net ([2601:2c3:480:7390:b620:ce9:47eb:26ab]) by smtp.gmail.com with ESMTPSA id g8-20020a9d6208000000b006b9848f8aa7sm4498841otj.45.2023.07.31.13.31.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 13:31:52 -0700 (PDT) From: Jorge Lopez X-Google-Original-From: Jorge Lopez To: hdegoede@redhat.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, thomas@t-8ch.de, ilpo.jarvinen@linux.intel.com, dan.carpenter@linaro.org Subject: [PATCH 8/8] hp-bioscfg: Remove duplicate use of variable in inner loop Date: Mon, 31 Jul 2023 15:31:41 -0500 Message-Id: <20230731203141.30044-9-jorge.lopez2@hp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230731203141.30044-1-jorge.lopez2@hp.com> References: <20230731203141.30044-1-jorge.lopez2@hp.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Replace use of same variable in inner loop. Signed-off-by: Jorge Lopez --- Based on the latest platform-drivers-x86.git/for-next --- .../x86/hp/hp-bioscfg/order-list-attributes.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c index 3b073910b430..cffc1c9ba3e7 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c @@ -136,6 +136,7 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord u32 size; u32 int_value = 0; int elem; + int olist_elem; int reqs; int eloc; char *tmpstr = NULL; @@ -147,10 +148,7 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord if (!order_obj) return -EINVAL; - for (elem = 1, eloc = 1; elem < order_obj_count; elem++, eloc++) { - /* ONLY look at the first ORDERED_ELEM_CNT elements */ - if (eloc == ORD_ELEM_CNT) - goto exit_list; + for (elem = 1, eloc = 1; eloc < ORD_ELEM_CNT; elem++, eloc++) { switch (order_obj[elem].type) { case ACPI_TYPE_STRING: @@ -277,10 +275,10 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord tmpstr, sizeof(ordered_list_data->elements[0])); - for (elem = 1; elem < MAX_ELEMENTS_SIZE && part; elem++) { - strscpy(ordered_list_data->elements[elem], + for (olist_elem = 1; olist_elem < MAX_ELEMENTS_SIZE && part; olist_elem++) { + strscpy(ordered_list_data->elements[olist_elem], part, - sizeof(ordered_list_data->elements[elem])); + sizeof(ordered_list_data->elements[olist_elem])); part = strsep(&part_tmp, SEMICOLON_SEP); }