fix(nimble): Address few coverity reported issues

1. too_few_printf_args: Corrected print statement to pass arguments
2. Fixed nesting levels
3. Fixed unused value warnings
This commit is contained in:
Rahul Tank
2025-01-03 11:33:42 +05:30
parent 4cf7d046d3
commit 16d59c062d
4 changed files with 5 additions and 5 deletions
-2
View File
@@ -1108,7 +1108,6 @@ ble_att_clt_tx_notify_mult(uint16_t conn_handle, struct os_mbuf *txom)
if (ble_att_cmd_get(BLE_ATT_OP_NOTIFY_MULTI_REQ, 0, &txom2) == NULL) {
return BLE_HS_ENOMEM;
goto err;
}
os_mbuf_concat(txom2, txom);
@@ -1119,7 +1118,6 @@ ble_att_clt_tx_notify_mult(uint16_t conn_handle, struct os_mbuf *txom)
ble_eatt_release_chan(conn_handle, BLE_GATT_OP_DUMMY);
}
err:
return rc;
}
+1 -1
View File
@@ -4674,7 +4674,7 @@ ble_gatts_notify_multiple_custom(uint16_t conn_handle,
*/
rc = ble_att_svr_read_local(tuples[i].handle, &tuples[i].value);
if (rc != 0) {
BLE_HS_LOG(ERROR, "Attribute read failed (err=0x%02x), rc");
BLE_HS_LOG(ERROR, "Attribute read failed (err=0x%02x)", rc);
goto done;
}
}
+2 -1
View File
@@ -1297,8 +1297,9 @@ ble_hs_hci_evt_process(struct ble_hci_ev *ev)
BLE_HS_LOG(DEBUG, "ble_hs_event_rx_hci_ev; opcode=0x%x ", ev->opcode);
/* For LE Meta, print subevent code */
if(ev->opcode == 0x3e)
if(ev->opcode == 0x3e) {
BLE_HS_LOG(DEBUG, "subevent: 0x%x", ev->data[0]);
}
BLE_HS_LOG(DEBUG, "\n");
}
+2 -1
View File
@@ -557,11 +557,12 @@ ble_sm_persist_keys(struct ble_sm_proc *proc)
switch (peer_addr.type) {
case BLE_ADDR_PUBLIC:
case BLE_ADDR_PUBLIC_ID:
conn->bhc_peer_addr.type = BLE_ADDR_PUBLIC_ID;
#if MYNEWT_VAL(BLE_HOST_BASED_PRIVACY)
/* In case of Host based privacy, we should not be changing
* peer address type to BLE_ADDR_PUBLIC_ID */
conn->bhc_peer_addr.type = BLE_ADDR_PUBLIC;
#else
conn->bhc_peer_addr.type = BLE_ADDR_PUBLIC_ID;
#endif
break;