Skip to content

Commit 4d24120

Browse files
danieldegrassekartben
authored andcommitted
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 <[email protected]>
1 parent d7c9c45 commit 4d24120

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/display/display_rm67162.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static int rm67162_write_fb(const struct device *dev, bool first_write,
350350
const uint8_t *src, uint32_t len)
351351
{
352352
const struct rm67162_config *config = dev->config;
353-
uint32_t wlen = 0;
353+
ssize_t wlen;
354354
struct mipi_dsi_msg msg = {0};
355355

356356
/* 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,
368368
msg.tx_buf = src;
369369
wlen = mipi_dsi_transfer(config->mipi_dsi, config->channel, &msg);
370370
if (wlen < 0) {
371-
return wlen;
371+
return (int)wlen;
372372
}
373373
/* Advance source pointer and decrement remaining */
374374
src += wlen;

0 commit comments

Comments
 (0)