All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gustavo F. Padovan" <padovan@profusion.mobi>
To: Anderson Lizardo <anderson.lizardo@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 01/15] Bluetooth: Create struct l2cap_chan
Date: Mon, 4 Apr 2011 17:07:15 -0300	[thread overview]
Message-ID: <20110404200715.GA2230@joana> (raw)
In-Reply-To: <BANLkTi=Ct=DwwJaU+qCk=SYFcD-ELz4XiA@mail.gmail.com>

Hi Lizardo.

* Anderson Lizardo <anderson.lizardo@openbossa.org> [2011-04-04 15:22:29 -0400]:

> Hi Gustavo,
> 
> On Fri, Apr 1, 2011 at 6:33 PM, Gustavo F. Padovan
> <padovan@profusion.mobi> wrote:
> > @@ -203,13 +217,14 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk)
> >                l2cap_pi(sk)->omtu = L2CAP_DEFAULT_MTU;
> >        }
> >
> > -       __l2cap_chan_link(l, sk);
> > +       __l2cap_chan_link(l, chan);
> >  }
> >
> >  /* Delete channel.
> >  * Must be called on the locked socket. */
> > -void l2cap_chan_del(struct sock *sk, int err)
> > +void l2cap_chan_del(struct l2cap_chan *chan, int err)
> >  {
> > +       struct sock *sk = chan->sk;
> >        struct l2cap_conn *conn = l2cap_pi(sk)->conn;
> >        struct sock *parent = bt_sk(sk)->parent;
> >
> > @@ -219,7 +234,7 @@ void l2cap_chan_del(struct sock *sk, int err)
> >
> >        if (conn) {
> >                /* Unlink from channel list */
> > -               l2cap_chan_unlink(&conn->chan_list, sk);
> > +               l2cap_chan_unlink(&conn->chan_list, chan);
> >                l2cap_pi(sk)->conn = NULL;
> >                hci_conn_put(conn->hcon);
> >        }
> > @@ -253,6 +268,8 @@ void l2cap_chan_del(struct sock *sk, int err)
> >                        kfree(l);
> >                }
> >        }
> > +
> > +       kfree(chan);
> 
> Just wondering: isn't also necessary to do "l2cap_pi(sk)->chan =
> NULL;" here, supposing the underlying struct sock will still be
> allocated?

No, it is always allocated. Just check the the comment on the top of the
function "Must be called on the locked socket" or the code itself.

-- 
Gustavo F. Padovan
http://profusion.mobi

      reply	other threads:[~2011-04-04 20:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01 22:33 [PATCH 00/15] L2CAP Rewrite (or create proper struct l2cap_chan) Gustavo F. Padovan
2011-04-01 22:33 ` [PATCH 01/15] Bluetooth: Create struct l2cap_chan Gustavo F. Padovan
2011-04-01 22:33   ` [PATCH 02/15] Bluetooth: Use struct list_head for L2CAP channels list Gustavo F. Padovan
2011-04-01 22:33     ` [PATCH 03/15] Bluetooth: Remove struct del_list Gustavo F. Padovan
2011-04-01 22:33       ` [PATCH 04/15] Bluetooth: Move ident to struct l2cap_chan Gustavo F. Padovan
2011-04-01 22:33         ` [PATCH 05/15] Bluetooth: Move conf_{req,rsp} stuff " Gustavo F. Padovan
2011-04-01 22:33           ` [PATCH 06/15] Bluetooth: clean up l2cap_sock_recvmsg() Gustavo F. Padovan
2011-04-01 22:33             ` [PATCH 07/15] Bluetooth: Move conn_state to struct l2cap_chan Gustavo F. Padovan
2011-04-01 22:33               ` [PATCH 08/15] Bluetooth: Move of ERTM *_seq vars " Gustavo F. Padovan
2011-04-01 22:33                 ` [PATCH 09/15] Bluetooth: Move more ERTM stuff " Gustavo F. Padovan
2011-04-01 22:33                   ` [PATCH 10/15] Bluetooth: Move SDU related vars " Gustavo F. Padovan
2011-04-01 22:33                     ` [PATCH 11/15] Bluetooth: Move remote info " Gustavo F. Padovan
2011-04-01 22:33                       ` [PATCH 12/15] Bluetooth: Move ERTM timers " Gustavo F. Padovan
2011-04-01 22:33                         ` [PATCH 13/15] Bluetooth: Move srej and busy queues " Gustavo F. Padovan
2011-04-01 22:33                           ` [PATCH 14/15] Bluetooth: Move busy workqueue " Gustavo F. Padovan
2011-04-01 22:33                             ` [PATCH 15/15] Bluetooth: Fix lockdep warning with skb list lock Gustavo F. Padovan
2011-04-04 21:00                         ` [PATCH 12/15] Bluetooth: Move ERTM timers to struct l2cap_chan Anderson Lizardo
2011-04-04 21:05                           ` Gustavo F. Padovan
2011-04-04 20:50               ` [PATCH 07/15] Bluetooth: Move conn_state " Anderson Lizardo
2011-04-04 20:58                 ` Gustavo F. Padovan
2011-04-04 20:28     ` [PATCH 02/15] Bluetooth: Use struct list_head for L2CAP channels list Anderson Lizardo
2011-04-04 19:22   ` [PATCH 01/15] Bluetooth: Create struct l2cap_chan Anderson Lizardo
2011-04-04 20:07     ` Gustavo F. Padovan [this message]

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=20110404200715.GA2230@joana \
    --to=padovan@profusion.mobi \
    --cc=anderson.lizardo@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.