Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: caif: fix error code handling

cfpkt_peek_head return 0 and 1, caller is checking error using <0

Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Tong Zhang and committed by
David S. Miller
e1046841 8e4efd47

+2 -2
+2 -2
net/caif/cfrfml.c
··· 116 116 if (segmented) { 117 117 if (rfml->incomplete_frm == NULL) { 118 118 /* Initial Segment */ 119 - if (cfpkt_peek_head(pkt, rfml->seghead, 6) < 0) 119 + if (cfpkt_peek_head(pkt, rfml->seghead, 6) != 0) 120 120 goto out; 121 121 122 122 rfml->pdu_size = get_unaligned_le16(rfml->seghead+4); ··· 233 233 if (cfpkt_getlen(pkt) > rfml->fragment_size + RFM_HEAD_SIZE) 234 234 err = cfpkt_peek_head(pkt, head, 6); 235 235 236 - if (err < 0) 236 + if (err != 0) 237 237 goto out; 238 238 239 239 while (cfpkt_getlen(frontpkt) > rfml->fragment_size + RFM_HEAD_SIZE) {