summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-rfcomm.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/dbus-rfcomm.c')
-rw-r--r--hcid/dbus-rfcomm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hcid/dbus-rfcomm.c b/hcid/dbus-rfcomm.c
index a7d7cbc1..f5c5708a 100644
--- a/hcid/dbus-rfcomm.c
+++ b/hcid/dbus-rfcomm.c
@@ -700,6 +700,7 @@ static struct service_data rfcomm_services[] = {
DBusHandlerResult handle_rfcomm_method(DBusConnection *conn, DBusMessage *msg,
void *data)
{
+ const struct hci_dbus_data *pdata = data;
service_handler_func_t handler;
if (!hcid_dbus_use_experimental())
@@ -710,6 +711,9 @@ DBusHandlerResult handle_rfcomm_method(DBusConnection *conn, DBusMessage *msg,
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
+ if (!pdata->up)
+ return error_not_ready(conn, msg);
+
/* Initialize the RFCOMM control socket if has not yet been done */
if (rfcomm_ctl < 0) {
rfcomm_ctl = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_RFCOMM);