Skip to content
Commit da2edb3e authored by Dan Carpenter's avatar Dan Carpenter Committed by Stephen Boyd
Browse files

clk: bcm: rpi: Fix off by one in raspberrypi_discover_clocks()



Smatch detected an off by one in this code:
    drivers/clk/bcm/clk-raspberrypi.c:374 raspberrypi_discover_clocks()
    error: buffer overflow 'data->hws' 16 <= 16

The data->hws[] array has RPI_FIRMWARE_NUM_CLK_ID elements so the >
comparison needs to changed to >=.

Fixes: 12c90f3f ("clk: bcm: rpi: Add variant structure")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/5a850b08-d2f5-4794-aceb-a6b468965139@kili.mountain


Reviewed-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent a7a0c7d5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment