]> git.baikalelectronics.ru Git - kernel.git/commit
caif: fix a signedness bug in cfpkt_iterate()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 19 Feb 2015 09:13:13 +0000 (12:13 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Feb 2015 22:35:14 +0000 (17:35 -0500)
commitb47859d1a2e170ecc4d8f99c80ffe931de18ee97
tree7998890a3cedcf7dab3edab58064306734d3707c
parent02d8fc0690b54a0816d0b84599c9ff7b56a6f2f1
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>
include/net/caif/cfpkt.h
net/caif/cffrml.c
net/caif/cfpkt_skbuff.c