Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp561955ybc; Tue, 12 Nov 2019 05:59:41 -0800 (PST) X-Google-Smtp-Source: APXvYqz3AgjZxtzqpqC2CoaGF2tU2Lxz9OaU9qrbafpeincbcJqShnhD6DyNeab1B9M27DUQlzJv X-Received: by 2002:a50:fa8a:: with SMTP id w10mr32833272edr.179.1573567181505; Tue, 12 Nov 2019 05:59:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573567181; cv=none; d=google.com; s=arc-20160816; b=u1/SpYMp1LYafBbXTy0lzE39kruHQIj3OwqMw3kplXNX6X3ZrifjXpIYB5wmGFQawG DAMuHSRQ3bGqspFppO34uH8V3YA6CwgJQN640Aq38E1AQK0U0JvnNxXVLqU+gdowOCSo o32gs9CfARhGvr++ZNtVYbH+g+CL1OG5SBMGvTbVbocJzwxXfkko/BmwNmJYKB0HPb2u E6cV+kMzKHYI2zb8i5vMzyJdQfzDUhUs338ue6mb5Ylpr/PmzawuzsrLG96uO5hq7/5d 33azacS3sUgtVJWEMrZ74wSLbqco5HUAJkBLKQzwa5OnPDeCeSTuICLB8zXGdyM2su+2 nFqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=zUlf+/ryyoNwKlzk3dAnMfQKmDSoLoEYMjwx/l0lxKg=; b=IMb+u1AzXFL12U661RGTT1sQBB3E1rmIuPhqvCwwIcsY4a7lVyyhrQsRrz8a7NZqd8 04n8/Ou15bRr8Z0xcyxisqoJfrsOosaf0kVh8MeWZ4j5zi/cx1jhXTAgiSRrbsCYEaiZ Q3NmudGbZPbYIBz58LTPQ38pzoO9DI8OuZlg+wuxi5Vw6y0yJGNcHjLRtWF3xNkTZ/Ae gzmSJEBh/XvKHAgEGhF+N662z6orh+qMPahduch/6CnnJvHN0YIqLItemhpsxp8FQ33U 0rQr+un7A8ig6E0XatAfpuoArdrML++uq6aIWlOtwgZl6aQlbT6cI+xktmCAnjPNBQ+H QgoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z37si13104547edz.281.2019.11.12.05.59.16; Tue, 12 Nov 2019 05:59:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725947AbfKLN4u (ORCPT + 99 others); Tue, 12 Nov 2019 08:56:50 -0500 Received: from bsmtp2.bon.at ([213.33.87.16]:13983 "EHLO bsmtp2.bon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbfKLN4u (ORCPT ); Tue, 12 Nov 2019 08:56:50 -0500 Received: from simon-pc.sueba (81.89.61.168.host.vnet.sk [81.89.61.168]) by bsmtp2.bon.at (Postfix) with ESMTPSA id 47C8S040kTz5tlb; Tue, 12 Nov 2019 14:56:48 +0100 (CET) From: Simon Mikuda To: linux-bluetooth@vger.kernel.org Cc: Simon Mikuda Subject: [PATCH BlueZ 2/2] core/advertising: Fix crash when client is added after unregistration Date: Tue, 12 Nov 2019 14:56:35 +0100 Message-Id: <1573566995-8482-2-git-send-email-simon.mikuda@streamunlimited.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573566995-8482-1-git-send-email-simon.mikuda@streamunlimited.com> References: <1573566995-8482-1-git-send-email-simon.mikuda@streamunlimited.com> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org After "register_advertisement()" callback "client_proxy_added()" was yet called but it was actually called after: "unregister_advertisement()" which caused segmentation fault because client was removed twice. Signed-off-by: Simon Mikuda --- src/advertising.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/advertising.c b/src/advertising.c index f53c14c..45ff19f 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -190,6 +190,8 @@ static void client_remove(void *data) struct btd_adv_client *client = data; struct mgmt_cp_remove_advertising cp; + g_dbus_client_set_proxy_handlers(client->client, NULL, NULL, NULL, + client); g_dbus_client_set_disconnect_watch(client->client, NULL, NULL); cp.instance = client->instance; -- 2.7.4