From: Dan Carpenter Date: Wed, 26 May 2010 05:16:48 +0000 (+0000) Subject: caif: unlock on error path in cfserl_receive() X-Git-Tag: MMI-PSA29.97-13-9~23139^2~172 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=97dc875f90a7b88a9fa476c256345c0d40fcdf6c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git caif: unlock on error path in cfserl_receive() 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 Acked-by: Sjur Brændeland Signed-off-by: David S. Miller --- diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c index cb4325a3dc83..965c5baace40 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; }