aboutsummaryrefslogtreecommitdiffstats
path: root/net/caif/cfserl.c
diff options
context:
space:
mode:
authorSjur Braendeland <sjur.brandeland@stericsson.com>2010-05-20 22:16:09 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-24 02:57:42 -0400
commit638e628a600a5c542d46dfb06771cf9c229ef5f3 (patch)
tree777d4d2b9aee8a1d4b0ce522bf3957023a9bfb7e /net/caif/cfserl.c
parent7aecf4944f2c05aafb73b4820e469c74b4ec8517 (diff)
caif: Bugfix - handle mem-allocation failures
Discovered bugs when injecting slab allocation failures. Add checks on all memory allocation. Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif/cfserl.c')
-rw-r--r--net/caif/cfserl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c
index 06029ea2da2f..cb4325a3dc83 100644
--- a/net/caif/cfserl.c
+++ b/net/caif/cfserl.c
@@ -67,6 +67,8 @@ static int cfserl_receive(struct cflayer *l, struct cfpkt *newpkt)
67 layr->incomplete_frm = 67 layr->incomplete_frm =
68 cfpkt_append(layr->incomplete_frm, newpkt, expectlen); 68 cfpkt_append(layr->incomplete_frm, newpkt, expectlen);
69 pkt = layr->incomplete_frm; 69 pkt = layr->incomplete_frm;
70 if (pkt == NULL)
71 return -ENOMEM;
70 } else { 72 } else {
71 pkt = newpkt; 73 pkt = newpkt;
72 } 74 }
@@ -154,7 +156,6 @@ static int cfserl_receive(struct cflayer *l, struct cfpkt *newpkt)
154 if (layr->usestx) { 156 if (layr->usestx) {
155 if (tail_pkt != NULL) 157 if (tail_pkt != NULL)
156 pkt = cfpkt_append(pkt, tail_pkt, 0); 158 pkt = cfpkt_append(pkt, tail_pkt, 0);
157
158 /* Start search for next STX if frame failed */ 159 /* Start search for next STX if frame failed */
159 continue; 160 continue;
160 } else { 161 } else {