From: David S. Miller Date: Sun, 18 Jun 2006 05:16:13 +0000 (-0700) Subject: [IRDA]: Use put_unaligned() in irlmp_do_discovery(). X-Git-Tag: firefly_0821_release~35488^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b293acfd3133393a81bcd382eb71a210c9cf9526;p=firefly-linux-kernel-4.4.55.git [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 . Signed-off-by: David S. Miller --- diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index c19e9ce05a3a..57ea160f470b 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c @@ -44,6 +44,8 @@ #include #include +#include + static __u8 irlmp_find_free_slsap(void); static int irlmp_slsap_inuse(__u8 slsap_sel); @@ -840,6 +842,7 @@ void irlmp_do_expiry(void) void irlmp_do_discovery(int nslots) { struct lap_cb *lap; + __u16 *data_hintsp; /* Make sure the value is sane */ if ((nslots != 1) && (nslots != 6) && (nslots != 8) && (nslots != 16)){ @@ -849,7 +852,8 @@ void irlmp_do_discovery(int nslots) } /* Construct new discovery info to be used by IrLAP, */ - u16ho(irlmp->discovery_cmd.data.hints) = irlmp->hints.word; + data_hintsp = (__u16 *) irlmp->discovery_cmd.data.hints; + put_unaligned(irlmp->hints.word, data_hintsp); /* * Set character set for device name (we use ASCII), and