* [patch] caif: unlock on error path in cfserl_receive()
@ 2010-05-26 15:16 Dan Carpenter
2010-05-26 18:18 ` Sjur Brændeland
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2010-05-26 15:16 UTC (permalink / raw)
To: Sjur Braendeland; +Cc: David S. Miller, netdev, kernel-janitors
There was an spin_unlock missing on the error path. The spin_lock was
tucked in with the declarations so it was hard to spot. I added a new
line.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c
index cb4325a..965c5ba 100644
--- a/net/caif/cfserl.c
+++ b/net/caif/cfserl.c
@@ -59,16 +59,18 @@ static int cfserl_receive(struct cflayer *l, struct cfpkt *newpkt)
u8 stx = CFSERL_STX;
int ret;
u16 expectlen = 0;
+
caif_assert(newpkt != NULL);
spin_lock(&layr->sync);
if (layr->incomplete_frm != NULL) {
-
layr->incomplete_frm =
cfpkt_append(layr->incomplete_frm, newpkt, expectlen);
pkt = layr->incomplete_frm;
- if (pkt == NULL)
+ if (pkt == NULL) {
+ spin_unlock(&layr->sync);
return -ENOMEM;
+ }
} else {
pkt = newpkt;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch] caif: unlock on error path in cfserl_receive()
2010-05-26 15:16 [patch] caif: unlock on error path in cfserl_receive() Dan Carpenter
@ 2010-05-26 18:18 ` Sjur Brændeland
2010-05-29 7:19 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Sjur Brændeland @ 2010-05-26 18:18 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Sjur Braendeland, David S. Miller, netdev, kernel-janitors
Hi Dan.
Dan Carpenter <error27@gmail.com> wrote:
> There was an spin_unlock missing on the error path. The spin_lock was
> tucked in with the declarations so it was hard to spot. I added a new
> line.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sjur Braendeland
Well spotted! Thanks for reviewing and fixing this.
Regards
Sjur
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] caif: unlock on error path in cfserl_receive()
2010-05-26 18:18 ` Sjur Brændeland
@ 2010-05-29 7:19 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-05-29 7:19 UTC (permalink / raw)
To: sjurbren; +Cc: error27, sjur.brandeland, netdev, kernel-janitors
From: Sjur Brændeland <sjurbren@gmail.com>
Date: Wed, 26 May 2010 20:18:36 +0200
> Hi Dan.
>
> Dan Carpenter <error27@gmail.com> wrote:
>> There was an spin_unlock missing on the error path. The spin_lock was
>> tucked in with the declarations so it was hard to spot. I added a new
>> line.
>>
>> Signed-off-by: Dan Carpenter <error27@gmail.com>
> Acked-by: Sjur Braendeland
Applied.
Sjur, in the future please provide your full email address in
Acked-by: lines just as you would for a Signed-off-by: tag.
I fixed it up this time.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-29 7:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 15:16 [patch] caif: unlock on error path in cfserl_receive() Dan Carpenter
2010-05-26 18:18 ` Sjur Brændeland
2010-05-29 7:19 ` 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).