platform/x86: wmi: Skip blocks with zero instances
PATCH 1/1 platform/x86: wmi: Skip blocks with zero instances
Some machines like the HP Omen 17 ck2000nf contain WMI blocks with zero instances, so any WMI driver which tries to handle the associated WMI device will fail.
Skip such WMI blocks to avoid confusing any WMI drivers.
Reported-by Alexis Belmonte <[email protected]>
Tested-by Alexis Belmonte <[email protected]>
Signed-off-by Armin Wolf <[email protected]>
--- drivers/platform/x86/wmi.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/platform/x86/wmi.c +5 -0
@@ -1346,6 +1346,11 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev)if (debug_dump_wdg)wmi_dump_wdg (&gblock[i]); +if (!gblock[i].instance_count) { +dev_info (wmi_bus_dev,FW_INFO "%pUL has zero instances\n" , &gblock[i].guid); +continue ; + } +if (guid_already_parsed_for_legacy (device, &gblock[i].guid))continue ;
--
2.39.2
Ilpo Järvinen
maintainerQuoted 9 lines · Armin Wolf
Some machines like the HP Omen 17 ck2000nf contain WMI blocks with zero instances, so any WMI driver which tries to handle the associated WMI device will fail.
Skip such WMI blocks to avoid confusing any WMI drivers.Reported-by Alexis Belmonte <[email protected]>Tested-by Alexis Belmonte <[email protected]>Signed-off-by Armin Wolf <[email protected]>
Thanks for the patch. Should this have a Fixes tag?
Signature · 1 line
i.
Quoted 23 lines
--- drivers/platform/x86/wmi.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/platform/x86/wmi.c +5
-1@@ -1346,6 +1346,11 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev)if (debug_dump_wdg)wmi_dump_wdg (&gblock[i]); +if (!gblock[i].instance_count) { +dev_info (wmi_bus_dev,FW_INFO "%pUL has zero instances\n" , &gblock[i].guid); +continue ; + } +if (guid_already_parsed_for_legacy (device, &gblock[i].guid))continue ; --2.39.2