Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2568899ybz; Sun, 3 May 2020 04:11:27 -0700 (PDT) X-Google-Smtp-Source: APiQypICtk38rP6Aq7in+9yjVjHQHakotiNjZBmBS0iYFLgboS2oPhnuI7DKQukzwswt65kbV1g9 X-Received: by 2002:a17:906:f251:: with SMTP id gy17mr9941128ejb.369.1588504287382; Sun, 03 May 2020 04:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588504287; cv=none; d=google.com; s=arc-20160816; b=JqqSSY/IAKxgUGuym2i4/zkmp8uZJRXpdz5GE9suEMT0EEpEDrp3X51BUbUAtE3v2Q 1C58/60SfhRzkwzbE6hxDqFYoc8uUGOQ/FtTxtpo5Dp2YMupyQCHk2N6PL6MnqCMRbkt 8xUrHGDYUD5nbAA5eg1DchyDjY2+QiGFOeKhLVbChYjTMLgSL2+qGdoGY9LS/AptC4Wh wG68qm2JKcewvvfV007HcSMrMupu4IzrcPSsLQ2hRldDU+nVej+dmuE2jh3X8yfSepZI /bxkqY0qXGL4peBGOxSzZYjbKb62aoJdXvQ8VKD+/Z0FltmFBMXVSyM0QlrHmgsDW/5Q /Dtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Q9/Zs2pRTtMyqwhkZ+L7NotlENHtftBSxDRa7ywFUqo=; b=RY9aFjNMrTNQDarZ6riXR+n/tbfaU6AwsdyYCVJWsHTKTcxo46shyM6MvyAoGyPxcl cXK3eLv1/c/XSdYIIYGieN2qs/GhG8BhhpKVGbkOkgAu7s7QRPnv3wjFwb7uRi6QS4AQ vnVj/oPfyjcespWOW76n+uesh+jGSi3yvUzINA4leTQEgnneIthdeP4ykdokBXHXW+Rz aIb+FXaA41vPBKwrWP9BMXLv5yqHejfS3Im7SwLs4LX4OXBrwf2sBsZDsPsiawuslgyX yGxk0jLYap425BjUQVMrD9UJo8KP8VGq1901sFnJb3K8qAtOpA5WzOcHuXqY8NeIaJSl 2dZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jmBAVjV7; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk4si5440909ejb.529.2020.05.03.04.11.03; Sun, 03 May 2020 04:11:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jmBAVjV7; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728095AbgECLLC (ORCPT + 99 others); Sun, 3 May 2020 07:11:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:55994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728091AbgECLLC (ORCPT ); Sun, 3 May 2020 07:11:02 -0400 Received: from pali.im (pali.im [31.31.79.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 217E62071C; Sun, 3 May 2020 11:11:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588504262; bh=MWzknOHXjm+2+xMnNuHwFdOoGHPEI6ZlsvXldm3iUNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jmBAVjV7YCxLt91yu52fS4hn1tlL8wiM9V5wcYIPBUnFdYFnNt3WVxbn9LgC2Wpzb Nv9qHtbg4tL9W4NpsiJFLmttiWE7jMrQSgJ1dhz4sp4MZYRO7MXqQ0vGz3nU0K9BX5 e6ZywbXcFsBzH3oa1EaUBlLYsBa2lO0OfCxR8xPg= Received: by pali.im (Postfix) id 33962A1E; Sun, 3 May 2020 13:11:00 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: linux-bluetooth@vger.kernel.org Cc: Luiz Augusto von Dentz Subject: [PATCH v2] device: Return error when ConnectProfile DBus method fails (second fix) Date: Sun, 3 May 2020 13:10:55 +0200 Message-Id: <20200503111055.11321-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200426210247.757-1-pali@kernel.org> References: <20200426210247.757-1-pali@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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