Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3756806ybx; Mon, 4 Nov 2019 02:23:14 -0800 (PST) X-Google-Smtp-Source: APXvYqwibjwBj3rzZ5uyzaKgsVabeS656ufbeOhTRuH9P+SFTiQNxnMDrPYDHnQirBIbU0kNgq8l X-Received: by 2002:aa7:d391:: with SMTP id x17mr2192488edq.43.1572862993998; Mon, 04 Nov 2019 02:23:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572862993; cv=none; d=google.com; s=arc-20160816; b=VkOs7MLzu1BcMXeU2/zuWT15C2YAPRg8UeQY6PzpluksGjkj/Y6FOqfNUNFf9BEgEG pyY3NioBAFyGY21ic/zjrJIPubhSUsiCBdLSu6K+iKW1V0R+fos6zXL9X1OQOPI7ObPC sMMCLM29uQPq8soY8yT1JaYUZPK6jXeCuuWd8rp8Hs43vA/ehvnJSIPQeJZTGAyr0JH/ SSEtSmSgsvyQaDE9Y5QfyCbDXjy833dLBIbEsJsDP1ex/PqXf1c2KBMgfcznQ4NoRjRb DE/T/4PtCwtrpWQNefT6eO6anrEoY3MJllRDTjjLIxMu2eVOoUWQWdacQF9rFPMihah/ EzGA== 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=Sl8eApEd/3uGxliachO1bY7Xg8/1574iN7dn03MDpJgWrkvSwZNFeeH+YTAOXfHExm hmcRLKC6Uu36mUjXsa4UPWFPrJs/kmpH2dTV+mwBI94qEIJ/ILBtG7G+AgHhMczdjvj9 juFy++Vh8b9A1Rb4/BFvvtfM0dnYOU5+luxlNERIf/znRyD47I4Xd4nEXkkoO8MoPuYt Oa5Fce4wzIY6ifZ8dksmvBImS7bqvTovjJ9poNdc/kIeyZK9cyi8lQE259Sc6h1jX7cD vpXJv2umubLCaBMo+HVP+jzwh/IirujoU2UWZxhNkQhVdFTJeLIFhAASdfzsxA5IxOXn tp+w== 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 o22si443575ejr.397.2019.11.04.02.22.50; Mon, 04 Nov 2019 02:23:13 -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 S1728144AbfKDKWj (ORCPT + 99 others); Mon, 4 Nov 2019 05:22:39 -0500 Received: from bsmtp2.bon.at ([213.33.87.16]:45168 "EHLO bsmtp2.bon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726441AbfKDKWj (ORCPT ); Mon, 4 Nov 2019 05:22:39 -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 47684Y6fmkz5tlM; Mon, 4 Nov 2019 11:22:37 +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: Mon, 4 Nov 2019 11:21:02 +0100 Message-Id: <1572862862-8536-2-git-send-email-simon.mikuda@streamunlimited.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1572862862-8536-1-git-send-email-simon.mikuda@streamunlimited.com> References: <157250771818414> <1572862862-8536-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