Skip to content

Commit 85c4b52

Browse files
jhedbergm-alperen-sener
authored andcommitted
[nrf fromtree] Bluetooth: Host: Fix overwriting ECC error value
Jump straight to the exit portion of the function in the case that psa_destroy_key() failed and we set err to a non-zero value. This also fixes Coverity CID 487701 "Code maintainability issues (UNUSED_VALUE)". Signed-off-by: Johan Hedberg <[email protected]> (cherry picked from commit 8b356fd)
1 parent d2b6d47 commit 85c4b52

File tree

1 file changed

+1
-0
lines changed
  • subsys/bluetooth/host

1 file changed

+1
-0
lines changed

subsys/bluetooth/host/ecc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ static void generate_dh_key(struct k_work *work)
220220
if (ret != PSA_SUCCESS) {
221221
LOG_ERR("Failed to destroy the key %d", ret);
222222
err = -EIO;
223+
goto exit;
223224
}
224225

225226
err = 0;

0 commit comments

Comments
 (0)