diff options
author | Bhavesh Parekh <bparekh@nvidia.com> | 2011-08-16 13:16:07 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-09-06 14:51:40 -0700 |
commit | bac4ffea8eb4462eb0183bcd5e7d84b545c98d85 (patch) | |
tree | 687e3fc3d94ae81cf43f607044542a9b8e505134 | |
parent | f737bc30ee9509a79e499c975b61c5f58bb19bb3 (diff) |
arm:tegra:common Validate params before ioremap
Adding the check for the params before doing io-remap and
accessing physical location of the framebuffer. When framebuffer
atag is not passed from the bootloader kernel will crash at this point.
Change-Id: I479226d1e3c8e5d6ac8ff57898a6f94220e2991d
Reviewed-on: http://git-master/r/47277
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 4661f9e1d368..b9b3e947d595 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -594,6 +594,9 @@ void tegra_move_framebuffer(unsigned long to, unsigned long from, void *from_virt; unsigned long i; + if (!size || !from || !to) + return; + BUG_ON(PAGE_ALIGN((unsigned long)to) != (unsigned long)to); BUG_ON(PAGE_ALIGN(from) != from); BUG_ON(PAGE_ALIGN(size) != size); |