linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo F. Padovan" <gustavo@las.ic.unicamp.br>
To: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org, Marcel Holtmann <marcel@holtmann.org>
Subject: Re: [PATCH] Bluetooth: Fix memory leak in l2cap
Date: Tue, 5 Jan 2010 20:33:35 -0200	[thread overview]
Message-ID: <6b53b1991001051433u3cfc8171w1aed9dc015391c2@mail.gmail.com> (raw)
In-Reply-To: <508e92ca0912230317t3e5ff05ep9f51ef326e5e9de7@mail.gmail.com>

On Wed, Dec 23, 2009 at 9:17 AM, Andrei Emeltchenko
<andrei.emeltchenko.news@gmail.com> wrote:
> Hi, Please check following patch (also attached)
>
> Move skb_clone after error confition check so it is not going
> potentially out of the scope.
>
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
> ---
> =A0net/bluetooth/l2cap.c | =A0 =A03 ++-
> =A01 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
> index 1120cf1..b927045 100644
> --- a/net/bluetooth/l2cap.c
> +++ b/net/bluetooth/l2cap.c
> @@ -1368,7 +1368,6 @@ static int l2cap_ertm_send(struct sock *sk)
>
> =A0 =A0 =A0 =A0while ((skb =3D sk->sk_send_head) && (!l2cap_tx_window_ful=
l(sk)) &&
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 !(pi->conn_state & L2CAP_CONN_REMOTE_BUSY)) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 tx_skb =3D skb_clone(skb, GFP_ATOMIC);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (pi->remote_max_tx &&
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bt_cb(skb)=
->retries =3D=3D pi->remote_max_tx) {
> @@ -1376,6 +1375,8 @@ static int l2cap_ertm_send(struct sock *sk)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
>
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 tx_skb =3D skb_clone(skb, GFP_ATOMIC);
> +
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bt_cb(skb)->retries++;
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0control =3D get_unaligned_le16(tx_skb->dat=
a + L2CAP_HDR_SIZE);
> --
> 1.6.0.4
>


Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>



--=20
Gustavo F. Padovan
http://padovan.org

  reply	other threads:[~2010-01-05 22:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-23 11:17 [PATCH] Bluetooth: Fix memory leak in l2cap Andrei Emeltchenko
2010-01-05 22:33 ` Gustavo F. Padovan [this message]
2010-01-07  3:47 ` 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=6b53b1991001051433u3cfc8171w1aed9dc015391c2@mail.gmail.com \
    --to=gustavo@las.ic.unicamp.br \
    --cc=andrei.emeltchenko.news@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).