Skip to content

Commit a8182aa

Browse files
danieldegrassekartben
authored andcommitted
drivers: display: display_rm67162: check ret value of gpio_add_callback
Check the return value of gpio_add_callback() in the display init function, to resolve an issue flagged by static analysis. Fixes #81921 Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
1 parent 4d24120 commit a8182aa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/display/display_rm67162.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,11 @@ static int rm67162_init(const struct device *dev)
334334
/* Init and install GPIO callback */
335335
gpio_init_callback(&data->te_gpio_cb, rm67162_te_isr_handler,
336336
BIT(config->te_gpio.pin));
337-
gpio_add_callback(config->te_gpio.port, &data->te_gpio_cb);
337+
ret = gpio_add_callback(config->te_gpio.port, &data->te_gpio_cb);
338+
if (ret < 0) {
339+
LOG_ERR("Could not add TE gpio callback");
340+
return ret;
341+
}
338342

339343
/* Setup te pin semaphore */
340344
k_sem_init(&data->te_sem, 0, 1);

0 commit comments

Comments
 (0)