Skip to content

Commit 73be143

Browse files
MariuszSkamrajhedberg
authored andcommitted
Bluetooth: gatt: Fix setting actual error in notify_cb
This fixes return error from notify_cb function that was never set up. As the result, the functions like bt_gatt_notify_cb and bt_gatt_indicate returned invalid error when failed to send notification. Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
1 parent 4cbb9d8 commit 73be143

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/bluetooth/host/gatt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2761,11 +2761,11 @@ static uint8_t notify_cb(const struct bt_gatt_attr *attr, uint16_t handle,
27612761

27622762
bt_conn_unref(conn);
27632763

2764+
data->err = err;
2765+
27642766
if (err < 0) {
27652767
return BT_GATT_ITER_STOP;
27662768
}
2767-
2768-
data->err = 0;
27692769
}
27702770

27712771
return BT_GATT_ITER_CONTINUE;

0 commit comments

Comments
 (0)