From patchwork Thu Jan 26 13:36:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fedor Pchelkin X-Patchwork-Id: 647336 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 242B1C61DA4 for ; Thu, 26 Jan 2023 13:36:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237068AbjAZNge (ORCPT ); Thu, 26 Jan 2023 08:36:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235630AbjAZNgb (ORCPT ); Thu, 26 Jan 2023 08:36:31 -0500 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CBFC173A; Thu, 26 Jan 2023 05:36:29 -0800 (PST) Received: from fedcomp.intra.ispras.ru (unknown [46.242.14.200]) by mail.ispras.ru (Postfix) with ESMTPSA id 64DC040737D5; Thu, 26 Jan 2023 13:36:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 64DC040737D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1674740187; bh=u4HtKIzLSzd4F3ze1HvDiXlZa3oeglD+pWYGWv87M9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LCio3+Sc2hDodHSvuXOH7F9JipEsi2Eh1BfRTqa9W/W4GR8FEbS+rIjcnvTsff4vu wSANx27rRbS8P/aBNqWv1oDyWdHDRlDBkxLJE8pnWF2xu/kDyGm7yplsz97TH/6e6f 1ixv5koeiJf54b4zcSFXqN/3S/7OfrjCIx5tndcs= From: Fedor Pchelkin To: stable@vger.kernel.org, Greg Kroah-Hartman Cc: Fedor Pchelkin , Archie Pusaka , Abhishek Pandit-Subedi , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Jakub Kicinski , linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org, Luiz Augusto von Dentz Subject: [PATCH 6.1 1/1] Bluetooth: hci_sync: cancel cmd_timer if hci_open failed Date: Thu, 26 Jan 2023 16:36:13 +0300 Message-Id: <20230126133613.815127-2-pchelkin@ispras.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230126133613.815127-1-pchelkin@ispras.ru> References: <20230126133613.815127-1-pchelkin@ispras.ru> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Archie Pusaka commit 97dfaf073f5881c624856ef293be307b6166115c upstream. If a command is already sent, we take care of freeing it, but we also need to cancel the timeout as well. Signed-off-by: Archie Pusaka Reviewed-by: Abhishek Pandit-Subedi Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Fedor Pchelkin --- net/bluetooth/hci_sync.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 8d6c8cbfe1de..aab3d85f4637 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -4703,6 +4703,7 @@ int hci_dev_open_sync(struct hci_dev *hdev) hdev->flush(hdev); if (hdev->sent_cmd) { + cancel_delayed_work_sync(&hdev->cmd_timer); kfree_skb(hdev->sent_cmd); hdev->sent_cmd = NULL; }