diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2008-09-25 21:43:34 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-26 03:42:20 -0400 |
commit | 379daf6290814e41f14880094b7b773640df2461 (patch) | |
tree | e9b016fd4b8dcb0e4fbe39af75db84f313b6fd75 /include/linux/ioport.h | |
parent | 9a22b6e76ba75fa0f3963cdec7829156d00a7173 (diff) |
IO resources, x86: ioremap sanity check to catch mapping requests exceeding the BAR sizes
Go through the iomem resource tree to check if any of the ioremap()
requests span more than any slot in the iomem resource tree and do
a WARN_ON() if we hit this check.
This will raise a red-flag, if some driver is mapping more than what
is needed. And hopefully identify possible corruptions much earlier.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/ioport.h')
-rw-r--r-- | include/linux/ioport.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index fded376b94e3..01712cf1a38b 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -169,6 +169,7 @@ extern struct resource * __devm_request_region(struct device *dev, | |||
169 | 169 | ||
170 | extern void __devm_release_region(struct device *dev, struct resource *parent, | 170 | extern void __devm_release_region(struct device *dev, struct resource *parent, |
171 | resource_size_t start, resource_size_t n); | 171 | resource_size_t start, resource_size_t n); |
172 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); | ||
172 | 173 | ||
173 | #endif /* __ASSEMBLY__ */ | 174 | #endif /* __ASSEMBLY__ */ |
174 | #endif /* _LINUX_IOPORT_H */ | 175 | #endif /* _LINUX_IOPORT_H */ |