[PATCH 5/8] hp-bioscfg: Change how order list size is evaluated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Update steps how order list size is evaluated

Signed-off-by: Jorge Lopez <jorge.lopez2@xxxxxx>

---
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
-- 
2.34.1




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux