* [PATCH 9/17] net/iucv: Add missing spin_unlock
@ 2010-05-26 15:56 Julia Lawall
2010-05-27 4:10 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2010-05-26 15:56 UTC (permalink / raw)
To: Ursula Braun, linux390, David S. , Miller, linux-s390, netdev,
linux-kernel
From: Julia Lawall <julia@diku.dk>
Add a spin_unlock missing on the error path. There seems like no reason
why the lock should continue to be held if the kzalloc fail.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression E1;
@@
* spin_lock(E1,...);
<+... when != E1
if (...) {
... when != E1
* return ...;
}
...+>
* spin_unlock(E1,...);
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
net/iucv/af_iucv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index c8b4599..9637e45 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -1619,7 +1619,7 @@ static void iucv_callback_rx(struct iucv_path *path, struct iucv_message *msg)
save_message:
save_msg = kzalloc(sizeof(struct sock_msg_q), GFP_ATOMIC | GFP_DMA);
if (!save_msg)
- return;
+ goto out_unlock;
save_msg->path = path;
save_msg->msg = *msg;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 9/17] net/iucv: Add missing spin_unlock
2010-05-26 15:56 [PATCH 9/17] net/iucv: Add missing spin_unlock Julia Lawall
@ 2010-05-27 4:10 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-05-27 4:10 UTC (permalink / raw)
To: julia
Cc: ursula.braun, linux390, linux-s390, netdev, linux-kernel,
kernel-janitors
From: Julia Lawall <julia@diku.dk>
Date: Wed, 26 May 2010 17:56:48 +0200 (CEST)
> Add a spin_unlock missing on the error path. There seems like no reason
> why the lock should continue to be held if the kzalloc fail.
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-27 4:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 15:56 [PATCH 9/17] net/iucv: Add missing spin_unlock Julia Lawall
2010-05-27 4:10 ` David Miller
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).