From patchwork Thu Jun 15 18:25:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Greer X-Patchwork-Id: 9789815 X-Patchwork-Delegate: sameo@linux.intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 25F6E60325 for ; Thu, 15 Jun 2017 18:26:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F4452861E for ; Thu, 15 Jun 2017 18:26:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13D812862C; Thu, 15 Jun 2017 18:26:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C11712861E for ; Thu, 15 Jun 2017 18:26:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752551AbdFOS0X (ORCPT ); Thu, 15 Jun 2017 14:26:23 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:58985 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753154AbdFOSZa (ORCPT ); Thu, 15 Jun 2017 14:25:30 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 49C7820A89; Thu, 15 Jun 2017 14:25:19 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Thu, 15 Jun 2017 14:25:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=animalcreek.com; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=sIB W6QMR4/dCXoyJSz0DAPCNQaOCs3oVMEv8n9ieBfA=; b=V03ibxF3z5O73g26BlX telnz2VZn7Pw9eOB2lhTPpf/ZdStsDEEtXvL5Pdkh3RijA+QvhHXxIxPqOk03WB5 DaPSBoRR0dAVMhzEDKsZp7yUoKdVaNVelHzsLAAYkmBkKz/Qv+tLj7A9XHnzvjny cS3cMsi3VUeWrWSG/AT+30E0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=sIBW6QMR4/dCXoyJSz0DAPCNQaOCs3oVMEv8n9ieB fA=; b=ZkisDF7SFX5Q4eqo2iGrjA2bQjqU4xOdDc2zu/FLis15DDY9JiYkll92r 9//b79U+Jurt5LR/qyHlpNfklyRV1zM2d1FSXA29jRMoXpgRJttvZe6ipNzqa+Mk jFNqqcnUosJ0aN9R9UKIpN7XewHhl/7VZQxNLbZ+KBP2bFPlpqSflkfWlafIxvrc Bg596QzPJPN/vT7m3FRvvKin9B0wVX0LTD4+zGvqwGYWXHVCK95si5y+89XVkWUA R0UQY18szdVq9odLIOqssmG7Z235etHJDIN2zC6GDLsHhDXdqAbvea1rG/Hf6GzJ y3//3EAQGhyYyBEPWkS8zh6q7YTxA== X-ME-Sender: X-Sasl-enc: cu4LOIwNthduCpqmzYeOfZb1iq2kolhSpAZ35Boh6pK9 1497551118 Received: from blue.animalcreek.com (ip68-2-81-12.ph.ph.cox.net [68.2.81.12]) by mail.messagingengine.com (Postfix) with ESMTPA id F25797E98D; Thu, 15 Jun 2017 14:25:18 -0400 (EDT) Received: from blue.animalcreek.com (localhost [127.0.0.1]) by blue.animalcreek.com (Postfix) with ESMTP id C4F69A20568; Thu, 15 Jun 2017 11:25:17 -0700 (MST) From: Mark Greer To: Samuel Ortiz Cc: linux-wireless@vger.kernel.org, linux-nfc@lists.01.org, Mark Greer Subject: [PATCH 09/23] adapter: Clear timeout handle when check presence timer stopped Date: Thu, 15 Jun 2017 11:25:02 -0700 Message-Id: <20170615182516.4508-10-mgreer@animalcreek.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170615182516.4508-1-mgreer@animalcreek.com> References: <20170615182516.4508-1-mgreer@animalcreek.com> Organization: Animal Creek Technologies, Inc. Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __near_adapter_stop_check_presence() stops the neard check presence timer but doesn't clear the timer handle. This can cause neard to try to stop the timer when it isn't running. To fix that, clear the handle so neard doesn't try to stop an already stopped timer. Signed-off-by: Mark Greer --- src/adapter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/adapter.c b/src/adapter.c index 466753b..7be87e2 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -505,8 +505,10 @@ void __near_adapter_stop_check_presence(uint32_t adapter_idx, if (!adapter) return; - if (adapter->presence_timeout > 0) + if (adapter->presence_timeout > 0) { g_source_remove(adapter->presence_timeout); + adapter->presence_timeout = 0; + } } static const GDBusMethodTable adapter_methods[] = {