lkml.org 
[lkml]   [2006]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Fix an inproper alignment accessing in irda protocol stack
From
From: "Luke Yang" <luke.adi@gmail.com>
Date: Wed, 14 Jun 2006 10:29:19 +0800

> For "struct irda_device_info" in irda.h:
> struct irda_device_info {
> __u32 saddr; /* Address of local interface */
> __u32 daddr; /* Address of remote device */
> char info[22]; /* Description */
> __u8 charset; /* Charset used for description */
> __u8 hints[2]; /* Hint bits */
> };
> The "hints" member aligns at the third byte of a word, an odd
> address. So if we visit "hints" as a short in irlmp.c:
>
> u16ho(irlmp->discovery_cmd.data.hints) = irlmp->hints.word;
>
> will cause alignment problem on some machines. Architectures with
> strict alignment rules do not allow 16-bit read on an odd address. I
> use le16_to_cpu to do the converting.
>
> Signed-off-by: Luke Yang <luke.adi@gmail.com>

This looks good, I will apply it, thanks a lot.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-14 05:45    [W:0.377 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site