* [PATCH] NFC: only put local on destruction if it was created before
@ 2012-06-12 20:08 Sasha Levin
2012-06-25 17:17 ` Samuel Ortiz
0 siblings, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2012-06-12 20:08 UTC (permalink / raw)
To: lauro.venancio-430g2QfJUUCGglJvpFV4uA,
aloisio.almeida-430g2QfJUUCGglJvpFV4uA,
sameo-VuQAYsv1563Yd54FQh9/CA, linville-2XuSBdqkA4R54TAoqtyWWQ
Cc: davej-H+wXaHxf7aLQT0dZR+AlfA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Sasha Levin
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 <levinsasha928-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
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);
}
static int llcp_sock_create(struct net *net, struct socket *sock,
--
1.7.8.6
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] NFC: only put local on destruction if it was created before
2012-06-12 20:08 [PATCH] NFC: only put local on destruction if it was created before Sasha Levin
@ 2012-06-25 17:17 ` Samuel Ortiz
2012-06-25 17:15 ` Sasha Levin
0 siblings, 1 reply; 4+ messages in thread
From: Samuel Ortiz @ 2012-06-25 17:17 UTC (permalink / raw)
To: Sasha Levin
Cc: lauro.venancio, aloisio.almeida, linville, davej, linux-wireless,
netdev, linux-kernel
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 <levinsasha928@gmail.com>
> ---
> 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.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] NFC: only put local on destruction if it was created before
2012-06-25 17:17 ` Samuel Ortiz
@ 2012-06-25 17:15 ` Sasha Levin
2012-06-25 17:29 ` Samuel Ortiz
0 siblings, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2012-06-25 17:15 UTC (permalink / raw)
To: Samuel Ortiz
Cc: lauro.venancio, aloisio.almeida, linville, davej, linux-wireless,
netdev, linux-kernel
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 <levinsasha928@gmail.com>
> > ---
> > 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?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] NFC: only put local on destruction if it was created before
2012-06-25 17:15 ` Sasha Levin
@ 2012-06-25 17:29 ` Samuel Ortiz
0 siblings, 0 replies; 4+ messages in thread
From: Samuel Ortiz @ 2012-06-25 17:29 UTC (permalink / raw)
To: Sasha Levin
Cc: lauro.venancio, aloisio.almeida, linville, davej, linux-wireless,
netdev, linux-kernel
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 <levinsasha928@gmail.com>
> > > ---
> > > 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/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-25 17:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-12 20:08 [PATCH] NFC: only put local on destruction if it was created before Sasha Levin
2012-06-25 17:17 ` Samuel Ortiz
2012-06-25 17:15 ` Sasha Levin
2012-06-25 17:29 ` Samuel Ortiz
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).