]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Bluetooth: Reinitialize the list after deletion for session user list
authorTedd Ho-Jeong An <tedd.an@intel.com>
Tue, 30 Jun 2015 18:43:40 +0000 (11:43 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 30 Jun 2015 19:46:19 +0000 (21:46 +0200)
commitab944c83f6690df0c7f67e6bcc29fc0c82ef6021
tree6bd6bc8d21cab72ef5c07b1e1fa963668fdb4b4c
parent7c258670ce655659a4c8d1013676c55e74d09ee7
Bluetooth: Reinitialize the list after deletion for session user list

If the user->list is deleted with list_del(), it doesn't initialize the
entry which can cause the issue with list_empty(). According to the
comment from the list.h, list_empty() returns false even if the list is
empty and put the entry in an undefined state.

/**
 * list_del - deletes entry from list.
 * @entry: the element to delete from the list.
 * Note: list_empty() on entry does not return true after this, the entry is
 * in an undefined state.
 */

Because of this behavior, list_empty() returns false even if list is empty
when the device is reconnected.

So, user->list needs to be re-initialized after list_del(). list.h already
have a macro list_del_init() which deletes the entry and initailze it again.

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Tested-by: Jörg Otte <jrg.otte@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap_core.c