USB: Add URB_FREE_BUFFER flag and the logic behind it
USB: Add URB_FREE_BUFFER flag for freeing the transfer buffer In some cases it is not needed that the driver keeps track of the transfer buffer of an URB. It can be simply freed along with the URB itself when the reference count goes down to zero. The new flag URB_FREE_BUFFER enables this behavior. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
300871cd96
commit
8b3b01c898
@@ -13,6 +13,9 @@ static void urb_destroy(struct kref *kref)
|
||||
{
|
||||
struct urb *urb = to_urb(kref);
|
||||
|
||||
if (urb->transfer_flags & URB_FREE_BUFFER)
|
||||
kfree(urb->transfer_buffer);
|
||||
|
||||
kfree(urb);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user