Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4045069yba; Mon, 29 Apr 2019 12:48:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNqlVpp5c7v11vtDddMsLbicE7btg9/Ii+cs0ArzH1yGaVDlv2YX6iwPmuaM2dtaT/Y09Y X-Received: by 2002:a63:b507:: with SMTP id y7mr28569018pge.237.1556567286645; Mon, 29 Apr 2019 12:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556567286; cv=none; d=google.com; s=arc-20160816; b=iX8T9D7Vy0sMkqqnWVyzIZ/xmKVc/78eVmpyYIjfpw9ez5TDOobhjnVpyElLzgp4PH CQ+V0/nig8ytTEVv0O3eXEgXEnx/Ck4TbbHIdfqnJumgIBCm9iDEXocfZMkjLs9rMjC6 qXbNq1Nk8Gst8PGjaHrAdwvUbZgd6W8r88lWumLB1vTV24k7kyc4jY6cJLGr+yjF0TnK k5IRwetUOpNbt1XHZsMqtm6Lg30MrKCmmqgEQ1vyj5yPYZgQnmaFYe4cbZDWXKebR4pR zmLPQk7Frj8UI7JNHbC0Lpeseo3U52SbbiqZp7GOc6sgRXkEyaue36DDlCq53J7NEL+b v0UA== 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=EVrvsj3sP7eG/zkzMPSQKxWaz5pW/sbxHNPj571is6c=; b=FTl1mg6nxe2tK/asSSONvCLW4oHiZuIUcOYeQU+9DeNpuFYdPd+JEVtevQBecwgEp5 zLSVhI15Wp4EGuD0oJroIsoex+mSuv+UalLPVvRSiYUumc/PkHttuD8f/Y9EtGKJAUyr 6ga9HTZC1r9YdcJDOBYGKBjCIbhqUqOOoWb0xuO5pKot+mqaEgMM3Kn1EK8WTIJil0iP OTpSaG/2luGJbtAjBIHIZ9LN4v4RhsYffkLrMjr6S/qhivjyp4x0vw4/hR2MsTvKbT5g XyArowS3GVvI4DmrjHFfN6Kll8KNgqpn2+CweseyM/T7xtYalNxJQhSrSokg58xbk8nW yCYQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h73si36667511pfj.220.2019.04.29.12.47.51; Mon, 29 Apr 2019 12:48:06 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729141AbfD2TpM (ORCPT + 99 others); Mon, 29 Apr 2019 15:45:12 -0400 Received: from mga02.intel.com ([134.134.136.20]:27048 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728928AbfD2TpM (ORCPT ); Mon, 29 Apr 2019 15:45:12 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 12:45:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,410,1549958400"; d="scan'208";a="144648060" Received: from ingas-nuc1.sea.intel.com ([10.252.200.123]) by fmsmga008.fm.intel.com with ESMTP; 29 Apr 2019 12:45:11 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, johan.hedberg@gmail.com, luiz.dentz@gmail.com, Inga Stotland Subject: [PATCH BlueZ 1/4] mesh: Remove Node interface if node owner disconnects Date: Mon, 29 Apr 2019 12:45:06 -0700 Message-Id: <20190429194509.3378-2-inga.stotland@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190429194509.3378-1-inga.stotland@intel.com> References: <20190429194509.3378-1-inga.stotland@intel.com> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This unregisters Node interface associated with a specific node application when this application disconnects from D-Bus. --- mesh/node.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mesh/node.c b/mesh/node.c index 157991dad..a6c9332bc 100644 --- a/mesh/node.c +++ b/mesh/node.c @@ -233,7 +233,7 @@ static void free_node_resources(void *data) if (node->path) l_dbus_object_remove_interface(dbus_get_bus(), node->path, - MESH_NODE_INTERFACE); + MESH_NODE_INTERFACE); l_free(node->path); l_free(node); @@ -1020,8 +1020,12 @@ static void app_disc_cb(struct l_dbus *bus, void *user_data) l_free(node->owner); node->owner = NULL; - l_free(node->app_path); - node->app_path = NULL; + if (node->path) { + l_dbus_object_remove_interface(dbus_get_bus(), node->path, + MESH_NODE_INTERFACE); + l_free(node->app_path); + node->app_path = NULL; + } } static bool validate_element_properties(struct mesh_node *node, -- 2.17.2