diff options
author | Ćukasz Majewski <l.majewski@samsung.com> | 2014-02-24 12:33:08 (GMT) |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-02-24 15:56:33 (GMT) |
commit | eae745379d4c6453d8f8888a8003a1c1ebcfbbd3 (patch) | |
tree | d50ee5458a84172dd4eb82cbca0e305e98ccc169 /drivers/power | |
parent | 6445262ca8d0400def05c4ef8e2b8e8424929599 (diff) | |
download | u-boot-eae745379d4c6453d8f8888a8003a1c1ebcfbbd3.tar.xz |
power: fix: Do not execute pmic command when not all necessary parameters are passed
Lack of this check resulted in a data abort when CPU tried to execute the
following command (without further mandatory input): 'pmic MAX77686_PMIC'.
Only the 'pmic list' command requires one passed parameter.
Other require at least two valid parameters for correct operation.
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/power_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/power/power_core.c b/drivers/power/power_core.c index 29ccc83..fe1f316 100644 --- a/drivers/power/power_core.c +++ b/drivers/power/power_core.c @@ -140,6 +140,9 @@ int do_pmic(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return CMD_RET_SUCCESS; } + if (argc < 3) + return CMD_RET_USAGE; + name = argv[1]; cmd = argv[2]; |