diff mbox series

[v2] device: Return error when ConnectProfile DBus method fails (second fix)

Message ID 20200503111055.11321-1-pali@kernel.org (mailing list archive)
State New, archived
Headers show
Series [v2] device: Return error when ConnectProfile DBus method fails (second fix) | expand

Commit Message

Pali Rohár May 3, 2020, 11:10 a.m. UTC
This is fixup of commit 3aa815a31017 ("device: Return error when
ConnectProfile DBus method fails"). There is another place which needs
to distinguish between Connect and ConnectProfile DBus method.
---
 src/device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Luiz Augusto von Dentz May 4, 2020, 11:38 p.m. UTC | #1
Hi Pali,

On Sun, May 3, 2020 at 4:11 AM Pali Rohár <pali@kernel.org> wrote:
>
> This is fixup of commit 3aa815a31017 ("device: Return error when
> ConnectProfile DBus method fails"). There is another place which needs
> to distinguish between Connect and ConnectProfile DBus method.
> ---
>  src/device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/device.c b/src/device.c
> index 229579378..7b0eb256e 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -1861,7 +1861,9 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
>         dev->pending = create_pending_list(dev, uuid);
>         if (!dev->pending) {
>                 if (dev->svc_refreshed) {
> -                       if (find_service_with_state(dev->services,
> +                       if (dbus_message_is_method_call(msg, DEVICE_INTERFACE,
> +                                                       "Connect") &&
> +                               find_service_with_state(dev->services,
>                                                 BTD_SERVICE_STATE_CONNECTED))
>                                 return dbus_message_new_method_return(msg);
>                         else
> --
> 2.20.1

Applied, thanks.
diff mbox series

Patch

diff --git a/src/device.c b/src/device.c
index 229579378..7b0eb256e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1861,7 +1861,9 @@  static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
 	dev->pending = create_pending_list(dev, uuid);
 	if (!dev->pending) {
 		if (dev->svc_refreshed) {
-			if (find_service_with_state(dev->services,
+			if (dbus_message_is_method_call(msg, DEVICE_INTERFACE,
+							"Connect") &&
+				find_service_with_state(dev->services,
 						BTD_SERVICE_STATE_CONNECTED))
 				return dbus_message_new_method_return(msg);
 			else