summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-02-19 10:13:13 +0100
committerDavid S. Miller <davem@davemloft.net>2015-02-20 23:35:14 +0100
commit278f7b4fffce9ad267406cf8800df271d14f4a16 (patch)
tree7998890a3cedcf7dab3edab58064306734d3707c /include
parentcxgb4: Fix incorrect 'c' suffix to %pI4, use %pISc instead (diff)
downloadlinux-278f7b4fffce9ad267406cf8800df271d14f4a16.tar.xz
linux-278f7b4fffce9ad267406cf8800df271d14f4a16.zip
caif: fix a signedness bug in cfpkt_iterate()
The cfpkt_iterate() function can return -EPROTO on error, but the function is a u16 so the negative value gets truncated to a positive unsigned short. This causes a static checker warning. The only caller which might care is cffrml_receive(), when it's checking the frame checksum. I modified cffrml_receive() so that it never says -EPROTO is a valid checksum. Also this isn't ever going to be inlined so I removed the "inline". Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/caif/cfpkt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/caif/cfpkt.h b/include/net/caif/cfpkt.h
index 1c1ad46250d5..fe328c52c46b 100644
--- a/include/net/caif/cfpkt.h
+++ b/include/net/caif/cfpkt.h
@@ -171,7 +171,7 @@ struct cfpkt *cfpkt_split(struct cfpkt *pkt, u16 pos);
* @return Checksum of buffer.
*/
-u16 cfpkt_iterate(struct cfpkt *pkt,
+int cfpkt_iterate(struct cfpkt *pkt,
u16 (*iter_func)(u16 chks, void *buf, u16 len),
u16 data);