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>
This commit is contained in:

committed by
David S. Miller

parent
c1cc678ada
commit
332223831e
@@ -1062,7 +1062,8 @@ void irlmp_discovery_expiry(discinfo_t *expiries, int number)
|
||||
for(i = 0; i < number; i++) {
|
||||
/* Check if we should notify client */
|
||||
if ((client->expir_callback) &&
|
||||
(client->hint_mask.word & u16ho(expiries[i].hints)
|
||||
(client->hint_mask.word &
|
||||
get_unaligned((__u16 *)expiries[i].hints)
|
||||
& 0x7f7f) )
|
||||
client->expir_callback(&(expiries[i]),
|
||||
EXPIRY_TIMEOUT,
|
||||
@@ -1086,7 +1087,7 @@ discovery_t *irlmp_get_discovery_response(void)
|
||||
|
||||
IRDA_ASSERT(irlmp != NULL, return NULL;);
|
||||
|
||||
u16ho(irlmp->discovery_rsp.data.hints) = irlmp->hints.word;
|
||||
put_unaligned(irlmp->hints.word, (__u16 *)irlmp->discovery_rsp.data.hints);
|
||||
|
||||
/*
|
||||
* Set character set for device name (we use ASCII), and
|
||||
|
Reference in New Issue
Block a user