aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irlmp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2006-06-18 01:16:13 -0400
committerDavid S. Miller <davem@davemloft.net>2006-06-18 01:16:13 -0400
commitb293acfd3133393a81bcd382eb71a210c9cf9526 (patch)
tree0b940bd69064a6fafa725d442ce6d93ebbe5254c /net/irda/irlmp.c
parent2c6cc0d8539f121c3c75aa3641c19b67e8723379 (diff)
[IRDA]: Use put_unaligned() in irlmp_do_discovery().
irda_device_info->hints[] is byte aligned but is being accessed as a u16 Based upon a patch by Luke Yang <luke.adi@gmail.com>. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda/irlmp.c')
-rw-r--r--net/irda/irlmp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c
index c19e9ce05a3..57ea160f470 100644
--- a/net/irda/irlmp.c
+++ b/net/irda/irlmp.c
@@ -44,6 +44,8 @@
44#include <net/irda/irlmp.h> 44#include <net/irda/irlmp.h>
45#include <net/irda/irlmp_frame.h> 45#include <net/irda/irlmp_frame.h>
46 46
47#include <asm/unaligned.h>
48
47static __u8 irlmp_find_free_slsap(void); 49static __u8 irlmp_find_free_slsap(void);
48static int irlmp_slsap_inuse(__u8 slsap_sel); 50static int irlmp_slsap_inuse(__u8 slsap_sel);
49 51
@@ -840,6 +842,7 @@ void irlmp_do_expiry(void)
840void irlmp_do_discovery(int nslots) 842void irlmp_do_discovery(int nslots)
841{ 843{
842 struct lap_cb *lap; 844 struct lap_cb *lap;
845 __u16 *data_hintsp;
843 846
844 /* Make sure the value is sane */ 847 /* Make sure the value is sane */
845 if ((nslots != 1) && (nslots != 6) && (nslots != 8) && (nslots != 16)){ 848 if ((nslots != 1) && (nslots != 6) && (nslots != 8) && (nslots != 16)){
@@ -849,7 +852,8 @@ void irlmp_do_discovery(int nslots)
849 } 852 }
850 853
851 /* Construct new discovery info to be used by IrLAP, */ 854 /* Construct new discovery info to be used by IrLAP, */
852 u16ho(irlmp->discovery_cmd.data.hints) = irlmp->hints.word; 855 data_hintsp = (__u16 *) irlmp->discovery_cmd.data.hints;
856 put_unaligned(irlmp->hints.word, data_hintsp);
853 857
854 /* 858 /*
855 * Set character set for device name (we use ASCII), and 859 * Set character set for device name (we use ASCII), and