mirror of git://git.sysmocom.de/ofono
telit: fix shutdown of bluetooth socket
This commit is contained in:
parent
53e005b200
commit
0e4a351282
|
@ -474,12 +474,12 @@ static int telit_sap_enable(struct ofono_modem *modem,
|
||||||
|
|
||||||
fd = telit_sap_open();
|
fd = telit_sap_open();
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return fd;
|
goto error;
|
||||||
|
|
||||||
data->hw_io = g_io_channel_unix_new(fd);
|
data->hw_io = g_io_channel_unix_new(fd);
|
||||||
if (data->hw_io == NULL) {
|
if (data->hw_io == NULL) {
|
||||||
close(fd);
|
close(fd);
|
||||||
return -ENOMEM;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_io_channel_set_encoding(data->hw_io, NULL, NULL);
|
g_io_channel_set_encoding(data->hw_io, NULL, NULL);
|
||||||
|
@ -520,6 +520,9 @@ static int telit_sap_enable(struct ofono_modem *modem,
|
||||||
return -EINPROGRESS;
|
return -EINPROGRESS;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
shutdown(bt_fd, SHUT_RDWR);
|
||||||
|
close(bt_fd);
|
||||||
|
|
||||||
sap_close_io(modem);
|
sap_close_io(modem);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue