提交 97dc875f 编写于 作者: D Dan Carpenter 提交者: David S. Miller

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: NDan Carpenter <error27@gmail.com>
Acked-by: NSjur Brændeland <sjurbren@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c196b02c
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册