linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: "Gustavo F. Padovan" <gustavo@padovan.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	Linux Bluetooth mailing list <linux-bluetooth@vger.kernel.org>
Subject: Re: Memory leak in btusb
Date: Sat, 06 Jun 2015 11:03:24 -0500	[thread overview]
Message-ID: <557319CC.1080709@lwfinger.net> (raw)
In-Reply-To: <FEA49882-9F1E-463F-9253-AD9E6AF8A762@holtmann.org>

On 06/06/2015 01:23 AM, Marcel Holtmann wrote:

> actually if this is only this device causing it, this might fix it:
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 94c6c048130f..e6815c678898 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -1614,6 +1614,8 @@ static int btusb_setup_intel(struct hci_dev *hdev)
>          }
>          fw_ptr = fw->data;
>
> +       kfree_skb(skb);
> +
>          /* This Intel specific command enables the manufacturer mode of the
>           * controller.
>           *
>
> Totally untested, but it seems we forget to free that SKB and it would explain if you only see this on Intel Wilkens Peak and Stone Peak controllers.

Marcel,

Thanks. My knowledge of btusb and the hci library is too meagre for me to find 
leaks.

I have tested this patch. To me, this looks like a real leak, particularly since 
skb is overwritten a few lines down; however, the one I see is still present. My 
device does load a firmware patch file. This patch may or may not be needed, but 
it does no harm that I see.

For the record, my device loads patch file ibt-hw-37.7.10-fw-1.80.2.3.d.bseq.

Larry

  reply	other threads:[~2015-06-06 16:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25 21:01 Memory leak in btusb Larry Finger
2015-06-06  6:20 ` Marcel Holtmann
2015-06-06  6:23 ` Marcel Holtmann
2015-06-06 16:03   ` Larry Finger [this message]
2015-06-06 16:37 ` Marcel Holtmann
2015-06-06 18:03   ` Larry Finger
2015-06-06 18:31     ` Marcel Holtmann
2015-06-06 21:31       ` Larry Finger
2015-06-06 21:38       ` Larry Finger
2015-06-06 22:54         ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=557319CC.1080709@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=gustavo@padovan.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).