From: Micah Dowty Date: Mon, 21 Jul 2008 16:59:09 +0000 (-0700) Subject: hdlcdrv: Fix CRC calculation. X-Git-Tag: v2.6.27-rc1~953^2~8 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ae6134bdf3197206fba95563d755d2fa50d90ddd;p=linux-2.6-omap-h63xx.git hdlcdrv: Fix CRC calculation. This is a trivial patch against the hdlcdrv module that fixes its CRC calculation. The finished CRC was overwriting the first two bytes of each packet rather than being appended to the end. I've tested this with 2.6.8 and 2.6.10-rc1, but hdlcdrv hasn't changed much recently so it should work with many other kernel versions. Signed-off-by: Micah Dowty Acked-by: Thomas Sailer Signed-off-by: David S. Miller --- diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index ae9629fa688..c258a0586e6 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c @@ -88,6 +88,7 @@ static inline void append_crc_ccitt(unsigned char *buffer, int len) { unsigned int crc = crc_ccitt(0xffff, buffer, len) ^ 0xffff; + buffer += len; *buffer++ = crc; *buffer++ = crc >> 8; }