Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp1584445lkv; Wed, 19 May 2021 13:22:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNIVRcaqzyAshx92Y73wrevp32w9lraoJxEPwSxP+sxRFOBQ97hxMeHawvihzkfpHHqwkJ X-Received: by 2002:a02:c73a:: with SMTP id h26mr1052099jao.95.1621455760228; Wed, 19 May 2021 13:22:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621455760; cv=none; d=google.com; s=arc-20160816; b=qFNn8qbjkyx67ThFydA/BLzMHZ8Y/IM6j6Rg5TYrWHQxWgXm/h80bsjCo0RzKqRq9r y95EBu2bVpbJOy/Qv2TWQA9sOkYBWWjep+Ep13y9dixkPW9ylamhJ1xoIWn/WiHE1waD IjnPomlnsUxFrFrrXt7FjUZ9HYK3PaiLrJj5g83FpBr9OBjXnswbYXqneWe37QYZsk7Z 8XyDJIdQSSQT1+XwiGrQPxk/72qR2sgbOrnfak5uIgMFeRklei66r3yTyFb/cdtL+vkR bjC+REV8MmCpoK/mJQsVnKBz35FixRmQB9wHQVBXJ/taumT5SBfqq3679uBe3TOcTSFo GJ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=Rvw3h94IZflqYMDmDWI1OcX5M4cvh3yW0IrcWLvkc8E=; b=CEGdOAODSmrnGK25NgsXnyES2iKOPqZn3m/f8Zj2Q8HHBEt2k/Fi1fjYn1iBXuroQ2 6PtgGtC7tF0561XNmBkBIlP2TDtY/GPTH1jLL2QkmtA52mOOjfzTHGw7p9Qkb+avxyHj 9EKc4g1ya6GI/kA2CW1rWeGFpZSMTyhlZ48QFawddMg/1m49QkEvn18klJ/VcTj1HubO 8hMWTK2+DvmAYVU3w2y9s+PdGeZeiMUSlto5rrCTte/LpVjO1vX6/zKi65oBgVRhyzwo 8sNoG7kPmiTNNz/cWzse1GZvVHlB1Fr0boSyialhPKKAXjDgpqBUnh4KrVYtNzpybgF3 Muig== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si379247jac.95.2021.05.19.13.22.26; Wed, 19 May 2021 13:22:40 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229379AbhESTLD (ORCPT + 99 others); Wed, 19 May 2021 15:11:03 -0400 Received: from mga06.intel.com ([134.134.136.31]:6668 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231899AbhESTLA (ORCPT ); Wed, 19 May 2021 15:11:00 -0400 IronPort-SDR: PPe4iNLl37GBVI2RRUi2RHEXIJOLMoiWmFvrt0BfPS1VM/1Bc5YLinYpTBMUnNxmfP8BjsgVKR PJqYuLPD9scQ== X-IronPort-AV: E=McAfee;i="6200,9189,9989"; a="262284404" X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="262284404" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 12:09:38 -0700 IronPort-SDR: 8CtRwYFHadFQWVilAP6qT1tLD6/XYLROwbNwQ4ceE67jgIjFTITMsziL+BBn/bcYLR1Ld7BKtU Ru7N0CPT+lYw== X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="439855277" Received: from bgi1-mobl2.amr.corp.intel.com ([10.212.229.7]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 12:09:37 -0700 From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: inga.stotland@intel.com, brian.gix@intel.com Subject: [PATCH BlueZ v3 6/6] mesh: Fix race condition memory leak Date: Wed, 19 May 2021 12:09:25 -0700 Message-Id: <20210519190925.1723012-7-brian.gix@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210519190925.1723012-1-brian.gix@intel.com> References: <20210519190925.1723012-1-brian.gix@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This is a minor fix of a memory leak triggered on process exit if proceess has been killed right after requesting an outbound advertisement be sent. It is harmless, but will cause an occasional static analysis failure. --- mesh/mesh-io-generic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c index 4eb7f27ce..6c0b8f0fd 100644 --- a/mesh/mesh-io-generic.c +++ b/mesh/mesh-io-generic.c @@ -462,7 +462,9 @@ static bool dev_destroy(struct mesh_io *io) bt_hci_unref(pvt->hci); l_timeout_remove(pvt->tx_timeout); l_queue_destroy(pvt->rx_regs, l_free); + l_queue_remove_if(pvt->tx_pkts, simple_match, pvt->tx); l_queue_destroy(pvt->tx_pkts, l_free); + l_free(pvt->tx); l_free(pvt); io->pvt = NULL; -- 2.25.4