Skip to content
Commit f42ae4bb authored by Markus Mayer's avatar Markus Mayer Committed by Krzysztof Kozlowski
Browse files

memory: brcmstb_dpfe: fix array index out of bounds

We would overrun the error_text array if we hit a TIMEOUT condition,
because we were using the error code "ETIMEDOUT" (which is 110) as an
array index.

We fix the problem by correcting the array index and by providing a
function to retrieve error messages rather than accessing the array
directly. The function includes a bounds check that prevents the array
from being overrun.

Link: https://lore.kernel.org/linux-arm-kernel/38d00022-730c-948a-917c-d86382df8cb9@canonical.com/
Link: https://lore.kernel.org/r/20200822205000.15841-1-mmayer@broadcom.com


Fixes: 2f330caf ("memory: brcmstb: Add driver for DPFE")
Reported-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarMarkus Mayer <mmayer@broadcom.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parent 4da1edcf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment