Skip to contentSkip to conversation

platform/x86: hp-wmi: Fix board_params typo for 8DD6 board

PATCH In review Arda Doğu Ari 3 participants 5 messages Aug 27 – Aug 31

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: hp-wmi: Fix board_params typo for 8DD6 board

When adding support for board 8DD6, &omen_v1_no_ec_thermal_params was passed as driver_data instead of &omen_v1_no_ec_board_params.

Because active_board_params expects a pointer to struct hp_wmi_board_params, dereferencing active_board_params->thermal_profile results in a type confusion bug and invalid memory access. Update the entry to point to omen_v1_no_ec_board_params.

Fixes a7320d6eb9c42 ("platform/x86: hp-wmi: Add support for OMEN MAX 16-ak0xxx (8DD6)")
---
 drivers/platform/x86/hp/hp-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/hp/hp-wmi.c +1 -1
index b2773fc1aca4..615b4cf6fc45 100644
@@ -337,7 +337,7 @@ static const struct dmi_system_id hp_wmi_feature_boards[] __initconst = {
 	},
 	{
 		.matches = { DMI_MATCH(DMI_BOARD_NAME, "8DD6") },
-		.driver_data = (void *)&omen_v1_no_ec_thermal_params,
+		.driver_data = (void *)&omen_v1_no_ec_board_params,
 	},
 	{
 		.matches = { DMI_MATCH(DMI_BOARD_NAME, "8E35") },
Signature · 1 line
2.55.0
#1 lore raw
Quoted 2 lines · Arda Doğu Ari

When adding support for board 8DD6, &omen_v1_no_ec_thermal_params was passed as driver_data instead of &omen_v1_no_ec_board_params.

Hi,

When I added support for 8DD6 [1] &omen_v1_no_ec_thermal_params was indeed the correct quirk. But because Radhey Kalra's board-specific feature data patch [2] was accepted first, my patch probably lead to a merge conflict that had to be resolved manually, which is why this is subtle bug got introduced in the first place.

Quoted 4 lines

Because active_board_params expects a pointer to struct hp_wmi_board_params, dereferencing active_board_params->thermal_profile results in a type confusion bug and invalid memory access. Update the entry to point to omen_v1_no_ec_board_params.

Thank you very much for observing and sending a patch for the same.

[1]: https://lore.kernel.org/platform-driver-x86/[email protected]
[2]: https://lore.kernel.org/platform-driver-x86/[email protected]

Quoted 23 lines
Fixes a7320d6eb9c42 ("platform/x86: hp-wmi: Add support for OMEN MAX 16-ak0xxx (8DD6)")

---
drivers/platform/x86/hp/hp-wmi.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/hp/hp-wmi.c +1 -1
index b2773fc1aca4..615b4cf6fc45 100644
@@ -337,7 +337,7 @@ static const struct dmi_system_id hp_wmi_feature_boards[] __initconst = {
 	},
 	{
 		.matches = { DMI_MATCH(DMI_BOARD_NAME, "8DD6") },
-		.driver_data = (void *)&omen_v1_no_ec_thermal_params,
+		.driver_data = (void *)&omen_v1_no_ec_board_params,
 	},
 	{
 		.matches = { DMI_MATCH(DMI_BOARD_NAME, "8E35") },
Signature · 1 line
2.55.0
maintainer
#2 lore raw
Quoted 11 lines · Krishna Chomal
Quoted 2 lines · Arda Doğu Ari

When adding support for board 8DD6, &omen_v1_no_ec_thermal_params was passed as driver_data instead of &omen_v1_no_ec_board_params.

Hi,

When I added support for 8DD6 [1] &omen_v1_no_ec_thermal_params was indeed the correct quirk. But because Radhey Kalra's board-specific feature data patch [2] was accepted first, my patch probably lead to a merge conflict that had to be resolved manually, which is why this is subtle bug got introduced in the first place.

It's my fault for not catching it (though to my defence, I got sick around the time the merge window ends so I had less time for handling the patches in the first place and I only now realize compiler won't catch this problem for me because the old structs are still there).

Quoted 6 lines
Quoted 4 lines

Because active_board_params expects a pointer to struct hp_wmi_board_params, dereferencing active_board_params->thermal_profile results in a type confusion bug and invalid memory access. Update the entry to point to omen_v1_no_ec_board_params.

Thank you very much for observing and sending a patch for the same.

I've queued the patch to the review-ilpo-fixes branch already. If Krishna wants to give a reviewed-by tag, I can still add that to the commit.

Signature · 1 line
 i.
Quoted 32 lines

[1]:
https://lore.kernel.org/platform-driver-x86/[email protected]
[2]:
https://lore.kernel.org/platform-driver-x86/[email protected]

Quoted 26 lines
Fixes a7320d6eb9c42 ("platform/x86: hp-wmi: Add support for OMEN MAX

16-ak0xxx (8DD6)")

---
drivers/platform/x86/hp/hp-wmi.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/hp/hp-wmi.c +1 -1
index b2773fc1aca4..615b4cf6fc45 100644
@@ -337,7 +337,7 @@ static const struct dmi_system_id
 hp_wmi_feature_boards[] __initconst = {
 	},
 	{
 		.matches = { DMI_MATCH(DMI_BOARD_NAME, "8DD6") },
-		.driver_data = (void *)&omen_v1_no_ec_thermal_params,
+		.driver_data = (void *)&omen_v1_no_ec_board_params,
 	},
 	{
		.matches = { DMI_MATCH(DMI_BOARD_NAME, "8E35") },
Signature · 1 line
2.55.0
Reviewed-by
#3 lore raw
Quoted 14 lines · Ilpo Järvinen
Quoted 11 lines · Krishna Chomal
Quoted 2 lines · Arda Doğu Ari

When adding support for board 8DD6, &omen_v1_no_ec_thermal_params was passed as driver_data instead of &omen_v1_no_ec_board_params.

Hi,

When I added support for 8DD6 [1] &omen_v1_no_ec_thermal_params was indeed the correct quirk. But because Radhey Kalra's board-specific feature data patch [2] was accepted first, my patch probably lead to a merge conflict that had to be resolved manually, which is why this is subtle bug got introduced in the first place.

Quoted 4 lines

It's my fault for not catching it (though to my defence, I got sick around the time the merge window ends so I had less time for handling the patches in the first place and I only now realize compiler won't catch this problem for me because the old structs are still there).

No problem, take care.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

Because active_board_params expects a pointer to struct hp_wmi_board_params, dereferencing active_board_params->thermal_profile results in a type confusion bug and invalid memory access. Update the entry to point to omen_v1_no_ec_board_params.

Thank you very much for observing and sending a patch for the same.

I've queued the patch to the review-ilpo-fixes branch already. If Krishna wants to give a reviewed-by tag, I can still add that to the commit.

Quoted 35 lines
Signature · 1 line
i.
Quoted 32 lines

[1]:
https://lore.kernel.org/platform-driver-x86/[email protected]
[2]:
https://lore.kernel.org/platform-driver-x86/[email protected]

Quoted 26 lines
Fixes a7320d6eb9c42 ("platform/x86: hp-wmi: Add support for OMEN MAX

16-ak0xxx (8DD6)")

---
drivers/platform/x86/hp/hp-wmi.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/hp/hp-wmi.c +1 -1
index b2773fc1aca4..615b4cf6fc45 100644
@@ -337,7 +337,7 @@ static const struct dmi_system_id
 hp_wmi_feature_boards[] __initconst = {
 	},
 	{
 		.matches = { DMI_MATCH(DMI_BOARD_NAME, "8DD6") },
-		.driver_data = (void *)&omen_v1_no_ec_thermal_params,
+		.driver_data = (void *)&omen_v1_no_ec_board_params,
 	},
 	{
		.matches = { DMI_MATCH(DMI_BOARD_NAME, "8E35") },

--
2.55.0

maintainer
#4 lore raw
In reply to Arda Doğu Ari
Quoted 9 lines · Arda Doğu Ari

When adding support for board 8DD6, &omen_v1_no_ec_thermal_params was passed as driver_data instead of &omen_v1_no_ec_board_params.

Because active_board_params expects a pointer to struct hp_wmi_board_params, dereferencing active_board_params->thermal_profile results in a type confusion bug and invalid memory access. Update the entry to point to omen_v1_no_ec_board_params.

[...]

Thank you for your contribution, it has been applied to my local review-ilpo-fixes branch. Note it will show up in the public platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: hp-wmi: Fix board_params typo for 8DD6 board

      commit: 9a71037abc42203caa9041906fb6d012390642a8

--
i.