This patch adds error-handling for the clk_set_rate() call inside the img_prl_out_hw_params function in the img-parallel-out.c file.
Signed-off-by: liuhaoran liuhaoran14@163.com --- sound/soc/img/img-parallel-out.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/img/img-parallel-out.c b/sound/soc/img/img-parallel-out.c index 815e68a7048c..698e9e92ded9 100644 --- a/sound/soc/img/img-parallel-out.c +++ b/sound/soc/img/img-parallel-out.c @@ -137,7 +137,10 @@ static int img_prl_out_hw_params(struct snd_pcm_substream *substream, if (channels != 2) return -EINVAL;
- clk_set_rate(prl->clk_ref, rate * 256); + int ret = clk_set_rate(prl->clk_ref, rate * 256); + + if (!ret) + return ret;
reg = img_prl_out_readl(prl, IMG_PRL_OUT_CTL); reg = (reg & ~IMG_PRL_OUT_CTL_PACKH_MASK) | control_set;