linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/2] NFC: double unlock in nfc_llcp_recv_connect()
@ 2011-12-16 20:25 Dan Carpenter
  2011-12-18 20:42 ` Samuel Ortiz
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-12-16 20:25 UTC (permalink / raw)
  To: Lauro Ramos Venancio
  Cc: Aloisio Almeida Jr, Samuel Ortiz, John W. Linville,
	linux-wireless, kernel-janitors

We unlock inside the if block on the other side of this if else
statement.  It could result in calling mutex_unlock() twice.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c
index 67756b2..f99d6b4 100644
--- a/net/nfc/llcp/llcp.c
+++ b/net/nfc/llcp/llcp.c
@@ -554,11 +554,9 @@ static void nfc_llcp_recv_connect(struct nfc_llcp_local *local,
 				goto enqueue;
 			}
 		}
-
+		mutex_unlock(&local->socket_lock);
 	}
 
-	mutex_unlock(&local->socket_lock);
-
 	reason = LLCP_DM_NOBOUND;
 	goto fail;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch 1/2] NFC: double unlock in nfc_llcp_recv_connect()
  2011-12-16 20:25 [patch 1/2] NFC: double unlock in nfc_llcp_recv_connect() Dan Carpenter
@ 2011-12-18 20:42 ` Samuel Ortiz
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2011-12-18 20:42 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Lauro Ramos Venancio, Aloisio Almeida Jr, John W. Linville,
	linux-wireless, kernel-janitors

Hi Dan,

On Fri, Dec 16, 2011 at 11:25:29PM +0300, Dan Carpenter wrote:
> We unlock inside the if block on the other side of this if else
> statement.  It could result in calling mutex_unlock() twice.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Thanks,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-18 20:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-16 20:25 [patch 1/2] NFC: double unlock in nfc_llcp_recv_connect() Dan Carpenter
2011-12-18 20:42 ` 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).