summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/nvos/nvos.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra/nvos/nvos.c')
-rw-r--r--arch/arm/mach-tegra/nvos/nvos.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/nvos/nvos.c b/arch/arm/mach-tegra/nvos/nvos.c
index 9b4329b97dc4..4de8cd4be33f 100644
--- a/arch/arm/mach-tegra/nvos/nvos.c
+++ b/arch/arm/mach-tegra/nvos/nvos.c
@@ -1445,8 +1445,7 @@ NvError NvOsBootArgGet(NvU32 key, void *arg, NvU32 size)
}
else
{
- switch (key)
- {
+ switch (key) {
case NvBootArgKey_ChipShmoo:
src = &s_BootArgs.ChipShmooArgs;
size_src = sizeof(NvBootArgsChipShmoo);
@@ -1478,10 +1477,19 @@ NvError NvOsBootArgGet(NvU32 key, void *arg, NvU32 size)
}
}
- if (!arg || !src || (size_src!=size))
+ if( !arg || !src )
+ {
return NvError_BadParameter;
+ }
- NvOsMemcpy(arg, src, size_src);
+ /* don't copy too much if the size has changed (gotten bigger in new
+ * binaries.
+ */
+ NvOsMemcpy(arg, src, NV_MIN( size, size_src) );
+ if( size > size_src )
+ {
+ NvOsMemset( (NvU8 *)src + size_src, 0, size - size_src );
+ }
return NvSuccess;
}