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>
This commit is contained in:
Dan Carpenter
2015-02-19 12:13:13 +03:00
committed by David S. Miller
부모 5a8eeec468
커밋 278f7b4fff
3개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제

파일 보기

@@ -84,7 +84,7 @@ static int cffrml_receive(struct cflayer *layr, struct cfpkt *pkt)
u16 tmp;
u16 len;
u16 hdrchks;
u16 pktchks;
int pktchks;
struct cffrml *this;
this = container_obj(layr);