Skip to content

Commit 5ba418c

Browse files
pirunnashif
authored andcommitted
Bluetooth: OTS: Fix coverity issue
Fixed issue Coverity CID: 316293 #58518 Signed-off-by: Pirun Lee <[email protected]>
1 parent 24bd211 commit 5ba418c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

subsys/bluetooth/services/ots/ots_oacp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ static enum bt_gatt_ots_oacp_res_code oacp_checksum_proc_validate(
211211
}
212212

213213
checksum = bt_ots_client_calc_checksum((const uint8_t *)obj_data, params->len);
214-
net_buf_simple_reserve(resp_param, sizeof(uint32_t));
215214
net_buf_simple_add_le32(resp_param, checksum);
216215
LOG_DBG("Calculate from offset %u len %u checksum 0x%08x\n", params->offset,
217216
params->len, checksum);
@@ -686,7 +685,7 @@ ssize_t bt_gatt_ots_oacp_write(struct bt_conn *conn,
686685
int decode_status;
687686
struct bt_gatt_ots_oacp_proc oacp_proc = {0};
688687
struct bt_ots *ots = (struct bt_ots *) attr->user_data;
689-
struct net_buf_simple resp_param;
688+
NET_BUF_SIMPLE_DEFINE(resp_param, sizeof(uint32_t));
690689

691690
LOG_DBG("Object Action Control Point GATT Write Operation");
692691

0 commit comments

Comments
 (0)