From: Peter Hurley Date: Mon, 10 Feb 2014 01:59:07 +0000 (-0500) Subject: Bluetooth: Release rfcomm_dev only once X-Git-Tag: v3.15-rc1~113^2~159^2^2~130^2~67 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c64834e0624c61735308138e67cc3b527f41621;p=pandora-kernel.git Bluetooth: Release rfcomm_dev only once No logic prevents an rfcomm_dev from being released multiple times. For example, if the rfcomm_dev ref count is large due to pending tx, then multiple RFCOMMRELEASEDEV ioctls may mistakenly release the rfcomm_dev too many times. Note that concurrent ioctls are not required to create this condition. Introduce RFCOMM_DEV_RELEASED status bit which guarantees the rfcomm_dev can only be released once. NB: Since the flags are exported to userspace, introduce the status field to track state for which userspace should not be aware. Signed-off-by: Peter Hurley Tested-By: Alexander Holler Signed-off-by: Marcel Holtmann --- Reading git-diff-tree failed