In get_lpuart_clk_rate if the call to clk_get_rate returns an error then
the call to return should pass the value of the error which is in rate
rather than ret which will be 0 as its value is not affected by this
error.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
rate = clk_get_rate(&clk);
if ((long)rate <= 0) {
dev_err(dev, "Failed to get clk rate: %ld\n", (long)rate);
- return ret;
+ return rate;
}
*clk_rate = rate;
return 0;