Skip to contentSkip to conversation

drivers/bluetooth/bpa10x.c: missing kfrees

PATCH In review Connor Hansen 1 participant 2 messages Jun 11, 2011 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/bluetooth/bpa10x.c: missing kfrees

both bpa10x_submit_initr_urb() and bpa10x_submit_bulk_urb() malloc a char buffer(buf) for usb_fill_init_usb() but fail to free it after freeing the urb.

Likewise, bpa10x_send_frame() allocates a usb_ctrlrequest(dr) for sending packets but does not free it after the usb_fill_control_urb() call.

---
 drivers/bluetooth/bpa10x.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/bluetooth/bpa10x.c +3 -0
index 751b338..7dfd9ca 100644
@@ -254,6 +254,7 @@ static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev)
 	}
 
 	usb_free_urb(urb);
+	kfree(buf);
 
 	return err;
 }
@@ -295,6 +296,7 @@ static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev)
 	}
 
 	usb_free_urb(urb);
+	kfree(buf);
 
 	return err;
 }
@@ -393,6 +395,7 @@ static int bpa10x_send_frame(struct sk_buff *skb)
 				skb->data, skb->len, bpa10x_tx_complete, skb);
 
 		hdev->stat.cmd_tx++;
+		kfree(df);
 		break;
 
 	case HCI_ACLDATA_PKT:
Signature · 1 line
1.7.4.4
#1 lore raw

sorry this contains an error, I will redo the patch

drivers/bluetooth/bpa10x.c static inline int bpa10x_submit_intr_urb(struct

Quoted 18 lines · Connor Hansen

both bpa10x_submit_initr_urb() and bpa10x_submit_bulk_urb() malloc a char buffer(buf) for usb_fill_init_usb() but fail to free it after freeing the urb.

Likewise, bpa10x_send_frame() allocates a usb_ctrlrequest(dr) for sending packets but does not free it after the usb_fill_control_urb() call.

---
 drivers/bluetooth/bpa10x.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/bluetooth/bpa10x.c +0 -0
index 751b338..7dfd9ca 100644
@@ -254,6 +254,7 @@ static inline int bpa10x_submit_intr_urb(struct

hci_dev *hdev)

drivers/bluetooth/bpa10x.c static inline int bpa10x_submit_bulk_urb(struct

Quoted 8 lines
drivers/bluetooth/bpa10x.c +1 -0
       }
 
       usb_free_urb(urb);
+       kfree(buf);
 
       return err;
 }
@@ -295,6 +296,7 @@ static inline int bpa10x_submit_bulk_urb(struct

hci_dev *hdev)

drivers/bluetooth/bpa10x.c static int bpa10x_send_frame(struct sk_buff *skb) · line 395

Quoted 9 lines
drivers/bluetooth/bpa10x.c +1 -0
       }
 
       usb_free_urb(urb);
+       kfree(buf);
 
       return err;
 }
@@ -393,6 +395,7 @@ static int bpa10x_send_frame(struct sk_buff *skb)
                               skb->data, skb->len, bpa10x_tx_complete,

skb);

Quoted 10 lines
drivers/bluetooth/bpa10x.c +1 -1
               hdev->stat.cmd_tx++;
+               kfree(df);
               break;
 
       case HCI_ACLDATA_PKT:
--

1.7.4.4