mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-17 01:04:40 +08:00
Only call g_io_channel_shutdown if the connection was actually successfull
This commit is contained in:
parent
4594c36cf3
commit
895239acf0
@ -617,7 +617,8 @@ static void avctp_connect_cb(GIOChannel *chan, GError *err, gpointer data)
|
||||
|
||||
if (!session) {
|
||||
debug("avctp_connect_cb: session removed while connecting");
|
||||
g_io_channel_shutdown(chan, TRUE, NULL);
|
||||
if (!err)
|
||||
g_io_channel_shutdown(chan, TRUE, NULL);
|
||||
g_io_channel_unref(chan);
|
||||
return;
|
||||
}
|
||||
|
@ -734,7 +734,8 @@ failed:
|
||||
g_io_channel_shutdown(iconn->ctrl_io, FALSE, NULL);
|
||||
|
||||
if (iconn->intr_io) {
|
||||
g_io_channel_shutdown(iconn->intr_io, FALSE, NULL);
|
||||
if (!conn_err)
|
||||
g_io_channel_shutdown(iconn->intr_io, FALSE, NULL);
|
||||
g_io_channel_unref(iconn->intr_io);
|
||||
iconn->intr_io = NULL;
|
||||
}
|
||||
|
@ -1653,7 +1653,8 @@ static void bonding_connect_cb(GIOChannel *io, GError *err, gpointer user_data)
|
||||
uint16_t handle;
|
||||
|
||||
if (!device->bonding) {
|
||||
g_io_channel_shutdown(io, TRUE, NULL);
|
||||
if (!err)
|
||||
g_io_channel_shutdown(io, TRUE, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user