-
由 Mans Rullgard 提交于
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: NMans Rullgard <mans@mansr.com> Tested-by: NRhyland Klein <rklein@nvidia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
9054a31d