mirror of git://git.sysmocom.de/ofono
handsfree-audio: Fix replying to an empty D-Bus message
In the case that ofono_handsfree_card_connect_sco() is called outside the context of a .Connect() call, there's no message we need to reply. This happens, for example, when the HFP AG plugin initiates a SCO connection when it receives an AT+BCC command from the HF.
This commit is contained in:
parent
856a884052
commit
8caf91bf0f
|
@ -248,7 +248,8 @@ static gboolean sco_connect_cb(GIOChannel *io, GIOCondition cond,
|
|||
}
|
||||
|
||||
if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
|
||||
reply = __ofono_error_failed(card->msg);
|
||||
if (card->msg)
|
||||
reply = __ofono_error_failed(card->msg);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -258,9 +259,13 @@ static gboolean sco_connect_cb(GIOChannel *io, GIOCondition cond,
|
|||
|
||||
close(sk);
|
||||
|
||||
reply = dbus_message_new_method_return(card->msg);
|
||||
if (card->msg)
|
||||
reply = dbus_message_new_method_return(card->msg);
|
||||
|
||||
done:
|
||||
if (card->msg == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (reply)
|
||||
g_dbus_send_message(ofono_dbus_get_connection(), reply);
|
||||
|
||||
|
|
Loading…
Reference in New Issue