aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/core/urb.c3
-rw-r--r--include/linux/usb.h1
2 files changed, 4 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)
13{ 13{
14 struct urb *urb = to_urb(kref); 14 struct urb *urb = to_urb(kref);
15 15
16 if (urb->transfer_flags & URB_FREE_BUFFER)
17 kfree(urb->transfer_buffer);
18
16 kfree(urb); 19 kfree(urb);
17} 20}
18 21
diff --git a/include/linux/usb.h b/include/linux/usb.h
index efce9a4c511c..533c32374e01 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -994,6 +994,7 @@ extern int usb_disabled(void);
994#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ 994#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */
995#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt 995#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt
996 * needed */ 996 * needed */
997#define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */
997 998
998struct usb_iso_packet_descriptor { 999struct usb_iso_packet_descriptor {
999 unsigned int offset; 1000 unsigned int offset;