From patchwork Thu Jan 26 13:38:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fedor Pchelkin X-Patchwork-Id: 13117096 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 70EEEC54E94 for ; Thu, 26 Jan 2023 13:38:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235630AbjAZNif (ORCPT ); Thu, 26 Jan 2023 08:38:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbjAZNie (ORCPT ); Thu, 26 Jan 2023 08:38:34 -0500 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 069E83EFE9; Thu, 26 Jan 2023 05:38:34 -0800 (PST) Received: from fedcomp.intra.ispras.ru (unknown [46.242.14.200]) by mail.ispras.ru (Postfix) with ESMTPSA id 168DF40D403D; Thu, 26 Jan 2023 13:38:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 168DF40D403D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1674740312; bh=QkDEpXH1Gip6cB8Z5DI/PU+3Jf6pqpNZOdCpsXvaOQk=; h=From:To:Cc:Subject:Date:From; b=jPwPhgaK9hbw2qhoci3+jAswqFODFk4bJLcZDSq7CHjM/4wkDP/URh8cHoFN5hYYp BHgB914VZRTVajsL3nyu2nWNAvsYjv6yW18W7ytB3QrZ4iKJqDn4+UKsjwINU/MmGu vx8bAH3BE6ZeXsuCT9US8r2M1kWX2ahok90vefig= 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 4.14/4.19/5.4/5.10/5.15] Bluetooth: hci_sync: cancel cmd_timer if hci_open failed Date: Thu, 26 Jan 2023 16:38:17 +0300 Message-Id: <20230126133817.819879-1-pchelkin@ispras.ru> X-Mailer: git-send-email 2.34.1 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_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index a41b4dcf1a7a..cabe8eb4c14f 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -1632,6 +1632,7 @@ static int hci_dev_do_open(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; }