Commit 5ac23fc0 authored by Zijun Hu's avatar Zijun Hu Committed by Greg Kroah-Hartman
Browse files

Bluetooth: hci_sock: Reset cookie to zero in hci_sock_free_cookie()



[ Upstream commit 4d7936e8 ]

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: default avatarZijun Hu <zijun.hu@oss.qualcomm.com>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b84f8874
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment