Skip to content

Commit 40da120

Browse files
committed
Fix CodeQL warning #70 in ESP32 SPI driver about passing a term to a function expecting a non-term
Removes the unnecessary use of esp_err_to_term, which takes an error integer and converts it to an atom term. The value passed was already a term (atom) and does not need any further processing before being passed to the create_pair funtion. Signed-off-by: Winford <winford@object.stream>
1 parent 4a6e5a9 commit 40da120

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/platforms/esp32/components/avm_builtins/spi_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ static NativeHandlerResult spidriver_consume_mailbox(Context *ctx)
658658
ret = OUT_OF_MEMORY_ATOM;
659659
}
660660
term unkn_a = globalcontext_make_atom(ctx->global, ATOM_STR("\xF", "unknown_command"));
661-
ret = create_pair(ctx, ERROR_ATOM, esp_err_to_term(ctx->global, unkn_a));
661+
ret = create_pair(ctx, ERROR_ATOM, unkn_a);
662662
}
663663

664664
term ret_msg;

0 commit comments

Comments
 (0)