diff options
author | Mans Rullgard <mans@mansr.com> | 2015-02-15 12:33:49 +0000 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-09-16 15:35:18 -0700 |
commit | 9054a31d603ea82c6ed4914170a8708812a16324 (patch) | |
tree | f04390e54f455155eea0975be5cf9e9ef23552b8 /drivers/clk/mmp | |
parent | e1595d89ae8180e0d3815cc75336ac3484de0aa0 (diff) | |
download | op-kernel-dev-9054a31d603ea82c6ed4914170a8708812a16324.zip op-kernel-dev-9054a31d603ea82c6ed4914170a8708812a16324.tar.gz |
clk: check for invalid parent index of orphans in __clk_init()
If a mux clock is initialised (by hardware or firmware) with an
invalid parent, its ->get_parent() can return an out of range
index. For example, the generic mux clock attempts to return
-EINVAL, which due to the u8 return type ends up a rather large
number. Using this index with the parent_names[] array results
in an invalid pointer and (usually) a crash in the following
strcmp().
This patch adds a check for the parent index being in range,
ignoring clocks reporting invalid values.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Tested-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/mmp')
0 files changed, 0 insertions, 0 deletions