Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757562Ab2FYRSH (ORCPT ); Mon, 25 Jun 2012 13:18:07 -0400 Received: from mga03.intel.com ([143.182.124.21]:47726 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756184Ab2FYRSF (ORCPT ); Mon, 25 Jun 2012 13:18:05 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="115832172" Date: Mon, 25 Jun 2012 19:29:06 +0200 From: Samuel Ortiz To: Sasha Levin Cc: lauro.venancio@openbossa.org, aloisio.almeida@openbossa.org, linville@tuxdriver.com, davej@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] NFC: only put local on destruction if it was created before Message-ID: <20120625172906.GD16275@sortiz-mobl> References: <1339531699-7377-1-git-send-email-levinsasha928@gmail.com> <20120625171738.GC16275@sortiz-mobl> <1340644546.31710.6.camel@lappy> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1340644546.31710.6.camel@lappy> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1564 Lines: 44 On Mon, Jun 25, 2012 at 07:15:46PM +0200, Sasha Levin wrote: > On Mon, 2012-06-25 at 19:17 +0200, Samuel Ortiz wrote: > > Hi Sasha, > > > > On Tue, Jun 12, 2012 at 10:08:19PM +0200, Sasha Levin wrote: > > > Not having 'local' is a valid case when a socket was created but never > > > bound or connected to anything, so avoid putting 'local' if it was > > > never created. > > > > > > Signed-off-by: Sasha Levin > > > --- > > > net/nfc/llcp/sock.c | 3 ++- > > > 1 files changed, 2 insertions(+), 1 deletions(-) > > > > > > diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c > > > index 2c0b317..54daa10 100644 > > > --- a/net/nfc/llcp/sock.c > > > +++ b/net/nfc/llcp/sock.c > > > @@ -710,7 +710,8 @@ void nfc_llcp_sock_free(struct nfc_llcp_sock *sock) > > > > > > sock->parent = NULL; > > > > > > - nfc_llcp_local_put(sock->local); > > > + if (sock->local) > > > + nfc_llcp_local_put(sock->local); > > nfc_llcp_local_put() already checks for its argument being NULL or not. > > nfc_llcp_local_put() triggers a warning in this case as well, which > means that this code path shouldn't be happening. > > Should we remove the WARN_ON from nfc_llcp_local_put() instead? Yes, that would be better. Cheers, Samuel. -- Intel Open Source Technology Centre http://oss.intel.com/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/