• Peter Hurley's avatar
    Bluetooth: Release rfcomm_dev only once · 1c64834e
    Peter Hurley authored
    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: default avatarPeter Hurley <peter@hurleysoftware.com>
    Tested-By: default avatarAlexander Holler <holler@ahsoftware.de>
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    1c64834e
rfcomm.h 9 KB