aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resource.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/resource.c')
-rw-r--r--drivers/acpi/resource.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index b7201fc6f1e1..0bdacc5e26a3 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -77,18 +77,24 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res)
77 switch (ares->type) { 77 switch (ares->type) {
78 case ACPI_RESOURCE_TYPE_MEMORY24: 78 case ACPI_RESOURCE_TYPE_MEMORY24:
79 memory24 = &ares->data.memory24; 79 memory24 = &ares->data.memory24;
80 if (!memory24->address_length)
81 return false;
80 acpi_dev_get_memresource(res, memory24->minimum, 82 acpi_dev_get_memresource(res, memory24->minimum,
81 memory24->address_length, 83 memory24->address_length,
82 memory24->write_protect); 84 memory24->write_protect);
83 break; 85 break;
84 case ACPI_RESOURCE_TYPE_MEMORY32: 86 case ACPI_RESOURCE_TYPE_MEMORY32:
85 memory32 = &ares->data.memory32; 87 memory32 = &ares->data.memory32;
88 if (!memory32->address_length)
89 return false;
86 acpi_dev_get_memresource(res, memory32->minimum, 90 acpi_dev_get_memresource(res, memory32->minimum,
87 memory32->address_length, 91 memory32->address_length,
88 memory32->write_protect); 92 memory32->write_protect);
89 break; 93 break;
90 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: 94 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
91 fixed_memory32 = &ares->data.fixed_memory32; 95 fixed_memory32 = &ares->data.fixed_memory32;
96 if (!fixed_memory32->address_length)
97 return false;
92 acpi_dev_get_memresource(res, fixed_memory32->address, 98 acpi_dev_get_memresource(res, fixed_memory32->address,
93 fixed_memory32->address_length, 99 fixed_memory32->address_length,
94 fixed_memory32->write_protect); 100 fixed_memory32->write_protect);
@@ -144,12 +150,16 @@ bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res)
144 switch (ares->type) { 150 switch (ares->type) {
145 case ACPI_RESOURCE_TYPE_IO: 151 case ACPI_RESOURCE_TYPE_IO:
146 io = &ares->data.io; 152 io = &ares->data.io;
153 if (!io->address_length)
154 return false;
147 acpi_dev_get_ioresource(res, io->minimum, 155 acpi_dev_get_ioresource(res, io->minimum,
148 io->address_length, 156 io->address_length,
149 io->io_decode); 157 io->io_decode);
150 break; 158 break;
151 case ACPI_RESOURCE_TYPE_FIXED_IO: 159 case ACPI_RESOURCE_TYPE_FIXED_IO:
152 fixed_io = &ares->data.fixed_io; 160 fixed_io = &ares->data.fixed_io;
161 if (!fixed_io->address_length)
162 return false;
153 acpi_dev_get_ioresource(res, fixed_io->address, 163 acpi_dev_get_ioresource(res, fixed_io->address,
154 fixed_io->address_length, 164 fixed_io->address_length,
155 ACPI_DECODE_10); 165 ACPI_DECODE_10);