public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] this mutex_lock is miss used
@ 2009-04-19 14:03 Zhenwen Xu
  2009-04-19 15:32 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Zhenwen Xu @ 2009-04-19 14:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: viro, eparis, linux-audit


This mutex_lock and mutex_unlock has no use in such way.
It should be like this way:

Signed-off-by: Zhenwen Xu <helight.xu@gmail.com>
---
 kernel/audit.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/kernel/audit.c b/kernel/audit.c
index 9442c35..3176ffa 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -485,12 +485,11 @@ int audit_send_list(void *_dest)
 
 	/* wait for parent to finish and send an ACK */
 	mutex_lock(&audit_cmd_mutex);
-	mutex_unlock(&audit_cmd_mutex);
-
 	while ((skb = __skb_dequeue(&dest->q)) != NULL)
 		netlink_unicast(audit_sock, skb, pid, 0);
 
 	kfree(dest);
+	mutex_unlock(&audit_cmd_mutex);
 
 	return 0;
 }
-- 
1.5.6.5

-- 
---------------------------------
Zhenwen Xu - Open and Free
Home Page:	http://zhwen.org
My Studio:	http://dim4.cn

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

end of thread, other threads:[~2009-04-19 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-19 14:03 [PATCH] this mutex_lock is miss used Zhenwen Xu
2009-04-19 15:32 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox