Commit 28966b26 authored by Stefan Wahren's avatar Stefan Wahren Committed by Jialin Zhang
Browse files

clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate

stable inclusion
from stable-v5.10.142
commit 00d8bc0c16edfaaf117aad0c6358ec549015413c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6CSFH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=00d8bc0c16edfaaf117aad0c6358ec549015413c



--------------------------------

[ Upstream commit 35f73cca ]

The function raspberrypi_fw_get_rate (e.g. used for the recalc_rate
hook) can fail to get the clock rate from the firmware. In this case
we cannot return a signed error value, which would be casted to
unsigned long. Fix this by returning 0 instead.

Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/20220625083643.4012-1-stefan.wahren@i2se.com


Fixes: 4e85e535 ("clk: bcm283x: add driver interfacing with Raspberry Pi's firmware")
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Reviewed-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 2e239be3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment