platform/x86: wmi: move variables
[ Upstream commit f5431bf1e6781e876bdc8ae10fb1e7da6f1aa9b5 ] Move some variables in order to keep them in the narrowest possible scope. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-22-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Stable-dep-of: 028e6e204ace ("platform/x86: wmi: Break possible infinite loop when parsing GUID") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
4bb2bb69bd
commit
7157ee0de5
@@ -134,7 +134,6 @@ static const void *find_guid_context(struct wmi_block *wblock,
|
|||||||
struct wmi_driver *wdriver)
|
struct wmi_driver *wdriver)
|
||||||
{
|
{
|
||||||
const struct wmi_device_id *id;
|
const struct wmi_device_id *id;
|
||||||
guid_t guid_input;
|
|
||||||
|
|
||||||
if (wblock == NULL || wdriver == NULL)
|
if (wblock == NULL || wdriver == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -143,6 +142,8 @@ static const void *find_guid_context(struct wmi_block *wblock,
|
|||||||
|
|
||||||
id = wdriver->id_table;
|
id = wdriver->id_table;
|
||||||
while (*id->guid_string) {
|
while (*id->guid_string) {
|
||||||
|
guid_t guid_input;
|
||||||
|
|
||||||
if (guid_parse(id->guid_string, &guid_input))
|
if (guid_parse(id->guid_string, &guid_input))
|
||||||
continue;
|
continue;
|
||||||
if (guid_equal(&wblock->gblock.guid, &guid_input))
|
if (guid_equal(&wblock->gblock.guid, &guid_input))
|
||||||
@@ -615,7 +616,6 @@ acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out)
|
|||||||
{
|
{
|
||||||
struct acpi_object_list input;
|
struct acpi_object_list input;
|
||||||
union acpi_object params[1];
|
union acpi_object params[1];
|
||||||
struct guid_block *gblock;
|
|
||||||
struct wmi_block *wblock;
|
struct wmi_block *wblock;
|
||||||
|
|
||||||
input.count = 1;
|
input.count = 1;
|
||||||
@@ -624,7 +624,7 @@ acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out)
|
|||||||
params[0].integer.value = event;
|
params[0].integer.value = event;
|
||||||
|
|
||||||
list_for_each_entry(wblock, &wmi_block_list, list) {
|
list_for_each_entry(wblock, &wmi_block_list, list) {
|
||||||
gblock = &wblock->gblock;
|
struct guid_block *gblock = &wblock->gblock;
|
||||||
|
|
||||||
if ((gblock->flags & ACPI_WMI_EVENT) &&
|
if ((gblock->flags & ACPI_WMI_EVENT) &&
|
||||||
(gblock->notify_id == event))
|
(gblock->notify_id == event))
|
||||||
@@ -1281,12 +1281,11 @@ acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address,
|
|||||||
static void acpi_wmi_notify_handler(acpi_handle handle, u32 event,
|
static void acpi_wmi_notify_handler(acpi_handle handle, u32 event,
|
||||||
void *context)
|
void *context)
|
||||||
{
|
{
|
||||||
struct guid_block *block;
|
|
||||||
struct wmi_block *wblock;
|
struct wmi_block *wblock;
|
||||||
bool found_it = false;
|
bool found_it = false;
|
||||||
|
|
||||||
list_for_each_entry(wblock, &wmi_block_list, list) {
|
list_for_each_entry(wblock, &wmi_block_list, list) {
|
||||||
block = &wblock->gblock;
|
struct guid_block *block = &wblock->gblock;
|
||||||
|
|
||||||
if (wblock->acpi_device->handle == handle &&
|
if (wblock->acpi_device->handle == handle &&
|
||||||
(block->flags & ACPI_WMI_EVENT) &&
|
(block->flags & ACPI_WMI_EVENT) &&
|
||||||
|
Reference in New Issue
Block a user