diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-09-28 14:42:49 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2011-10-11 07:23:54 -0700 |
commit | 2774b5dd0722426876d3c54e1b2ecdc54061c6b5 (patch) | |
tree | e81ee21bce69fe7f37e604561be5f9018359aa44 /arch | |
parent | 3ea4ea8a5594cb8b5781bfd06816993b0a3e90cf (diff) |
arm: tegra: Avoid negative number parsing for debug port
Avoiding negative number parsing for debug port id.
bug 854995
Change-Id: I6307d43136510d50c9614f8696bb41448e9823b9
Reviewed-on: http://git-master/r/54924
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/common.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 27e36b2a9f3f..6cdc473de8fb 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -528,15 +528,22 @@ __setup("core_edp_mv=", tegra_pmu_core_edp); static int __init tegra_debug_uartport(char *info) { char *p = info; + unsigned long long port_id; if (!strncmp(p, "hsport", 6)) is_tegra_debug_uart_hsport = true; else if (!strncmp(p, "lsport", 6)) is_tegra_debug_uart_hsport = false; - if (p[6] == ',') - debug_uart_port_id = memparse(p + 7, &p); - else + if (p[6] == ',') { + if (p[7] == '-') { + debug_uart_port_id = -1; + } else { + port_id = memparse(p + 7, &p); + debug_uart_port_id = (int) port_id; + } + } else { debug_uart_port_id = -1; + } return 1; } |