aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irlmp.c
diff options
context:
space:
mode:
authorGraf Yang <graf.yang@analog.com>2008-05-14 02:25:57 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-14 02:25:57 -0400
commit332223831e86b2e17b48b4afafad07d8e3b73861 (patch)
treea3bd42005c91888c3cb20ec0ca6880e3181e7acb /net/irda/irlmp.c
parentc1cc678adaa78ae2aab6a6d699241ad516d84476 (diff)
irda: Fix a misalign access issue. (v2)
Replace u16ho with put/get_unaligned functions Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda/irlmp.c')
-rw-r--r--net/irda/irlmp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c
index 1f81f8e7c61d..7bf5b913828b 100644
--- a/net/irda/irlmp.c
+++ b/net/irda/irlmp.c
@@ -1062,7 +1062,8 @@ void irlmp_discovery_expiry(discinfo_t *expiries, int number)
1062 for(i = 0; i < number; i++) { 1062 for(i = 0; i < number; i++) {
1063 /* Check if we should notify client */ 1063 /* Check if we should notify client */
1064 if ((client->expir_callback) && 1064 if ((client->expir_callback) &&
1065 (client->hint_mask.word & u16ho(expiries[i].hints) 1065 (client->hint_mask.word &
1066 get_unaligned((__u16 *)expiries[i].hints)
1066 & 0x7f7f) ) 1067 & 0x7f7f) )
1067 client->expir_callback(&(expiries[i]), 1068 client->expir_callback(&(expiries[i]),
1068 EXPIRY_TIMEOUT, 1069 EXPIRY_TIMEOUT,
@@ -1086,7 +1087,7 @@ discovery_t *irlmp_get_discovery_response(void)
1086 1087
1087 IRDA_ASSERT(irlmp != NULL, return NULL;); 1088 IRDA_ASSERT(irlmp != NULL, return NULL;);
1088 1089
1089 u16ho(irlmp->discovery_rsp.data.hints) = irlmp->hints.word; 1090 put_unaligned(irlmp->hints.word, (__u16 *)irlmp->discovery_rsp.data.hints);
1090 1091
1091 /* 1092 /*
1092 * Set character set for device name (we use ASCII), and 1093 * Set character set for device name (we use ASCII), and