--- src/shared/mgmt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/shared/mgmt.c b/src/shared/mgmt.c index ae90b89..bfc7258 100644 --- a/src/shared/mgmt.c +++ b/src/shared/mgmt.c @@ -209,8 +209,11 @@ static void wakeup_writer(struct mgmt *mgmt) if (mgmt->writer_active) return; - io_set_write_handler(mgmt->io, can_write_data, mgmt, - write_watch_destroy); + if (!io_set_write_handler(mgmt->io, can_write_data, mgmt, + write_watch_destroy)) + return; + + mgmt->writer_active = true; } struct opcode_index { -- 1.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html