]> git.baikalelectronics.ru Git - kernel.git/commit
drm: bridge: sii8620: fix possible off-by-one
authorHangyu Hua <hbh25y@gmail.com>
Wed, 18 May 2022 06:58:56 +0000 (14:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:27 +0000 (14:23 +0200)
commite90d2c6f9c7dccf004e73fe4e8c64e264793ee29
tree086387b23f5877098f793240aae69ad0210fc299
parent30b70243010cc8824afa98e827d11a6421440dc6
drm: bridge: sii8620: fix possible off-by-one

[ Upstream commit 351abede6d848281ad5481c5bc697c42bb96949c ]

The next call to sii8620_burst_get_tx_buf will result in off-by-one
When ctx->burst.tx_count + size == ARRAY_SIZE(ctx->burst.tx_buf). The same
thing happens in sii8620_burst_get_rx_buf.

This patch also change tx_count and tx_buf to rx_count and rx_buf in
sii8620_burst_get_rx_buf. It is unreasonable to check tx_buf's size and
use rx_buf.

Fixes: 0601b1778ca0 ("drm/bridge/sii8620: add support for burst eMSC transmissions")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220518065856.18936-1-hbh25y@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/bridge/sil-sii8620.c