[PATCH 6/8] hp-bioscfg: Change how enum possible values size is evaluated

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

 



Updates steps how enum possible values 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/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
-- 
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