[patch] caif: fix endian conversion in cffrml_transmit()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The "tmp" variable here is used to store the result of cpu_to_le16()
so it should be a u16 instead of an int.  We want the high bits set
and the current code works on little endian systems but not on big
endian systems.

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
This is a static checker thing.  I haven't tested it.  Please review
carefully.

diff --git a/net/caif/cffrml.c b/net/caif/cffrml.c
index f399211..2b46c48 100644
--- a/net/caif/cffrml.c
+++ b/net/caif/cffrml.c
@@ -136,10 +136,11 @@ static int cffrml_receive(struct cflayer *layr, struct cfpkt *pkt)
 
 static int cffrml_transmit(struct cflayer *layr, struct cfpkt *pkt)
 {
-	int tmp;
+	u16 tmp;
 	u16 chks;
 	u16 len;
 	struct cffrml *this = container_obj(layr);
+
 	if (this->dofcs) {
 		chks = cfpkt_iterate(pkt, cffrml_checksum, 0xffff);
 		tmp = cpu_to_le16(chks);
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux