Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] drivers/bluetooth/bpa10x.c: missing kfrees
@ 2011-06-11 21:21 Connor Hansen
  2011-06-11 21:26 ` Connor Hansen
  0 siblings, 1 reply; 2+ messages in thread
From: Connor Hansen @ 2011-06-11 21:21 UTC (permalink / raw)
  To: marcel; +Cc: padovan, linux-bluetooth, linux-kernel, 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.

Signed-off-by: Connor Hansen <cmdkhh@gmail.com>
---
 drivers/bluetooth/bpa10x.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
index 751b338..7dfd9ca 100644
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -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:
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers/bluetooth/bpa10x.c: missing kfrees
  2011-06-11 21:21 [PATCH] drivers/bluetooth/bpa10x.c: missing kfrees Connor Hansen
@ 2011-06-11 21:26 ` Connor Hansen
  0 siblings, 0 replies; 2+ messages in thread
From: Connor Hansen @ 2011-06-11 21:26 UTC (permalink / raw)
  To: marcel; +Cc: padovan, linux-bluetooth, linux-kernel, Connor Hansen

[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]

sorry this contains an error, I will redo the patch

On Sat, Jun 11, 2011 at 2:21 PM, Connor Hansen <cmdkhh@gmail.com> wrote:
> 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.
>
> Signed-off-by: Connor Hansen <cmdkhh@gmail.com>
> ---
>  drivers/bluetooth/bpa10x.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
> index 751b338..7dfd9ca 100644
> --- a/drivers/bluetooth/bpa10x.c
> +++ b/drivers/bluetooth/bpa10x.c
> @@ -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:
> --
> 1.7.4.4
>
>

[-- Attachment #2: Type: text/html, Size: 1804 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-11 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-11 21:21 [PATCH] drivers/bluetooth/bpa10x.c: missing kfrees Connor Hansen
2011-06-11 21:26 ` Connor Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox