mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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 <error27@gmail.com> Acked-by: Sjur Brændeland <sjurbren@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c196b02ce6
commit
97dc875f90
1 changed files with 4 additions and 2 deletions
|
@ -59,16 +59,18 @@ static int cfserl_receive(struct cflayer *l, struct cfpkt *newpkt)
|
||||||
u8 stx = CFSERL_STX;
|
u8 stx = CFSERL_STX;
|
||||||
int ret;
|
int ret;
|
||||||
u16 expectlen = 0;
|
u16 expectlen = 0;
|
||||||
|
|
||||||
caif_assert(newpkt != NULL);
|
caif_assert(newpkt != NULL);
|
||||||
spin_lock(&layr->sync);
|
spin_lock(&layr->sync);
|
||||||
|
|
||||||
if (layr->incomplete_frm != NULL) {
|
if (layr->incomplete_frm != NULL) {
|
||||||
|
|
||||||
layr->incomplete_frm =
|
layr->incomplete_frm =
|
||||||
cfpkt_append(layr->incomplete_frm, newpkt, expectlen);
|
cfpkt_append(layr->incomplete_frm, newpkt, expectlen);
|
||||||
pkt = layr->incomplete_frm;
|
pkt = layr->incomplete_frm;
|
||||||
if (pkt == NULL)
|
if (pkt == NULL) {
|
||||||
|
spin_unlock(&layr->sync);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
pkt = newpkt;
|
pkt = newpkt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue