diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-09-28 14:42:49 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-10-13 18:35:01 -0700 |
commit | 9696e2c71e4d0a58d86d9997ef0d215f64570462 (patch) | |
tree | 584ae0a506da82cd81632555724387664b23292f | |
parent | c9ed9c7f81c95f0775b3fbf68fff03df42481864 (diff) |
arm: tegra: Avoid negative number parsing for debug port
Avoiding negative number parsing for debug port id.
bug 854995
Reviewed-on: http://git-master/r/57328
(cherry picked from commit 81ce6594db0a2b9131e3a1317ef1f10e8310aad5)
Change-Id: I38e9e545c06a61b79d292c86dcbf8c595d2eddca
Reviewed-on: http://git-master/r/57787
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
-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 8b8adb7302c8..a7303e3dda30 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -406,15 +406,22 @@ early_param("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; } |