aboutsummaryrefslogtreecommitdiff
path: root/net/caif/cfserl.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/caif/cfserl.c')
-rw-r--r--net/caif/cfserl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c
index cb4325a3dc8..965c5baace4 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;
}