From mboxrd@z Thu Jan 1 00:00:00 1970 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 A0802C61DA4 for ; Fri, 3 Feb 2023 10:20:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232148AbjBCKUn (ORCPT ); Fri, 3 Feb 2023 05:20:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233274AbjBCKT1 (ORCPT ); Fri, 3 Feb 2023 05:19:27 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 515959EE0B for ; Fri, 3 Feb 2023 02:19:01 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0FA9461E89 for ; Fri, 3 Feb 2023 10:19:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA519C433EF; Fri, 3 Feb 2023 10:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675419539; bh=+DuxHoLDq1pQ/HZ/BFLrRRpeJ/4BXh1hOVTNg/EXDe8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RI0R/HroBSqbn7ZGdLRb1747wYlqGwmwGvQ7+t3BAYfBMLtTHemVnZwkEMsINNecB vui6wslwGhatmsfceyU0eG5xpeuZz/pl8LqQvXJSK5irdbyozwm3/v2iqQDrZkkKyT tcRFyygO7uIo1fEyd0C5tLTrnKdS2D4i22piK2Oc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Archie Pusaka , Abhishek Pandit-Subedi , Luiz Augusto von Dentz , Fedor Pchelkin , Sasha Levin Subject: [PATCH 4.19 36/80] Bluetooth: hci_sync: cancel cmd_timer if hci_open failed Date: Fri, 3 Feb 2023 11:12:30 +0100 Message-Id: <20230203101016.721453196@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203101015.263854890@linuxfoundation.org> References: <20230203101015.263854890@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@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 Signed-off-by: Sasha Levin --- 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 e87777255c47..497c8ac140d1 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -1519,6 +1519,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; } -- 2.39.0