drivers: display: display_rm67162: fix unsigned compare against 0

"wlen" variable set to return value of mipi_dsi_transfer should be a
ssize_t type, so that if a negative value is returned the error will be
caught and returned.

Fixes #81929

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse 2024-12-03 16:47:36 -06:00 committed by Benjamin Cabé
commit 4d24120dcf

View file

@ -350,7 +350,7 @@ static int rm67162_write_fb(const struct device *dev, bool first_write,
const uint8_t *src, uint32_t len)
{
const struct rm67162_config *config = dev->config;
uint32_t wlen = 0;
ssize_t wlen;
struct mipi_dsi_msg msg = {0};
/* Note- we need to set custom flags on the DCS message,
@ -368,7 +368,7 @@ static int rm67162_write_fb(const struct device *dev, bool first_write,
msg.tx_buf = src;
wlen = mipi_dsi_transfer(config->mipi_dsi, config->channel, &msg);
if (wlen < 0) {
return wlen;
return (int)wlen;
}
/* Advance source pointer and decrement remaining */
src += wlen;