projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b0cdd82
)
cmd: clk: test the number of argument in setfreq command
author
Patrick Delaunay
<patrick.delaunay@foss.st.com>
Mon, 31 Jan 2022 16:21:37 +0000
(17:21 +0100)
committer
Sean Anderson
<seanga2@gmail.com>
Fri, 25 Feb 2022 06:41:04 +0000
(
01:41
-0500)
Test the number of argument in setfreq command to avoid a crash when
the command setfreq is called without argument:
STM32MP> clk setfreq
data abort
pc : [<
ddba3f18
>] lr : [<
ddba3f89
>]
reloc pc : [<
c018ff18
>] lr : [<
c018ff89
>]
sp :
dbaf45b8
ip :
ddb1d859
fp :
00000002
r10:
dbb3fd80
r9 :
dbb11e90
r8 :
ddbf38cc
r7 :
ddb39725
r6 :
00000000
r5 :
00000000
r4 :
dbb3fd84
r3 :
dbb3fd84
r2 :
0000000a
r1 :
dbaf45bc
r0 :
00000011
Flags: nzCv IRQs off FIQs off Mode SVC_32 (T)
Code: 4dd3 1062 85a3 ddbd (7803) 2b30
Resetting CPU ...
Fixes: 7ab418fbe612 ("clk: add support for setting clk rate from cmdline")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link:
https://lore.kernel.org/r/20220131172131.1.I32a8f213d330dccd922f7aafc60d3d63fcbe8615@changeid
cmd/clk.c
patch
|
blob
|
history
diff --git
a/cmd/clk.c
b/cmd/clk.c
index dbbdc31b35bc2b4b3e32f9871c038a6487453cd9..52237791cf627cc459fcbf1778051018a2f2b29b 100644
(file)
--- a/
cmd/clk.c
+++ b/
cmd/clk.c
@@
-120,6
+120,9
@@
static int do_clk_setfreq(struct cmd_tbl *cmdtp, int flag, int argc,
s32 freq;
struct udevice *dev;
+ if (argc != 3)
+ return CMD_RET_USAGE;
+
freq = dectoul(argv[2], NULL);
dev = clk_lookup(argv[1]);