]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: hci_sock: Reset cookie to zero in hci_sock_free_cookie()
authorZijun Hu <zijun.hu@oss.qualcomm.com>
Mon, 23 Jun 2025 12:31:16 +0000 (20:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:05 +0000 (18:41 +0200)
commit8a6921521f6c5fc641d571bd2fd849254db91144
tree7cf34e8ceccd1165733930c9b0e9269dd3a3b888
parent4c0da9fa43518bd00324de8a046fb3faaa00652c
Bluetooth: hci_sock: Reset cookie to zero in hci_sock_free_cookie()

[ Upstream commit 4d7936e8a5b1fa803f4a631d2da4a80fa4f0f37f ]

Reset cookie value to 0 instead of 0xffffffff in hci_sock_free_cookie()
since:
0         :  means cookie has not been assigned yet
0xffffffff:  means cookie assignment failure

Also fix generating cookie failure with usage shown below:
hci_sock_gen_cookie(sk)   // generate cookie
hci_sock_free_cookie(sk)  // free cookie
hci_sock_gen_cookie(sk)   // Can't generate cookie any more

Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/hci_sock.c