Return-Path: Date: Fri, 14 Sep 2012 09:40:58 +0300 From: Andrei Emeltchenko To: Mat Martineau Cc: linux-bluetooth@vger.kernel.org, gustavo@padovan.org Subject: Re: [PATCHv4 02/17] Bluetooth: A2MP: Create amp_mgr global list Message-ID: <20120914064051.GA7483@aemeltch-MOBL1> References: <1347437192-24694-1-git-send-email-Andrei.Emeltchenko.news@gmail.com> <1347437192-24694-3-git-send-email-Andrei.Emeltchenko.news@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Mat, On Thu, Sep 13, 2012 at 08:02:58AM -0700, Mat Martineau wrote: ... > >@@ -550,6 +558,10 @@ static struct amp_mgr *amp_mgr_create(struct l2cap_conn *conn) > > > > conn->hcon->amp_mgr = mgr; > > > >+ mutex_lock(&_mgr_list_lock); > >+ list_add(&mgr->list, &_mgr_list); > >+ mutex_unlock(&_mgr_list_lock); > >+ > > kref_init(&mgr->kref); > > Should the reference count be initialized before adding to the list? will change this. Best regards Andrei Emeltchenko