summaryrefslogtreecommitdiff
path: root/src/include/device
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/device')
-rw-r--r--src/include/device/device.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 367635a952..1b2e097772 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -369,10 +369,12 @@ const struct resource *fixed_io_range_flags(struct device *dev, unsigned long in
static inline
const struct resource *fixed_io_from_to_flags(struct device *dev, unsigned long index,
- uint16_t base, uint16_t end, unsigned long flags)
+ uint16_t base, uint32_t end, unsigned long flags)
{
if (end <= base)
return NULL;
+ if (end > UINT16_MAX + 1)
+ return NULL;
return fixed_io_range_flags(dev, index, base, end - base, flags);
}
@@ -393,10 +395,12 @@ const struct resource *domain_io_window_range(struct device *dev, unsigned long
static inline
const struct resource *domain_io_window_from_to(struct device *dev, unsigned long index,
- uint16_t base, uint16_t end)
+ uint16_t base, uint32_t end)
{
if (end <= base)
return NULL;
+ if (end > UINT16_MAX + 1)
+ return NULL;
return domain_io_window_range(dev, index, base, end - base);
}