summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-06-13 08:02:11 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-13 01:34:38 +0200
commit8b3b01c898a44c2fc7217eb579982b9d132113f5 (patch)
tree4d7da145c0fa47243b0f67b62fcdfaa4f53d184e /drivers/usb
parentUSB: Fix up full-speed bInterval values in high-speed interrupt descriptor (diff)
downloadlinux-8b3b01c898a44c2fc7217eb579982b9d132113f5.tar.xz
linux-8b3b01c898a44c2fc7217eb579982b9d132113f5.zip
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/urb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index ac4273dddf34..52ec44b828f3 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -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);
}