From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04DDD1FB9 for ; Fri, 3 Feb 2023 10:27:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F8F5C433D2; Fri, 3 Feb 2023 10:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675420074; bh=4QcpRAWeCWrIZEF5TK8SkoVCjZyNcxMcOpJaMH90qgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l5TQgnZ0ze6WP/EnxDfmTdrn5N3lCIRDgIEBx+5FkxJcEBk/QyMs0aZVLAvCj0ZPh C6xp3oo/qZcGE9S2ffYAf5xgiVOSZcBuT4RFSeZ5OfduqGi2TtUtxCtunyMssuO0z2 3MQ29GEJHlqK7TjksV1EhB/n1Fr9DeJUAMbT4TUU= 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 5.4 072/134] Bluetooth: hci_sync: cancel cmd_timer if hci_open failed Date: Fri, 3 Feb 2023 11:12:57 +0100 Message-Id: <20230203101027.099852995@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203101023.832083974@linuxfoundation.org> References: <20230203101023.832083974@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 e5e1c139f211..eb5b2f45deec 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -1582,6 +1582,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