From: Pablo Neira Ayuso Date: Tue, 16 Mar 2010 13:30:44 +0000 (+0000) Subject: netlink: fix unaligned access in nla_get_be64() X-Git-Tag: v2.6.34-rc3~33^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5d410f2ea7ba340f11815a56e05b9fa9421c421;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git netlink: fix unaligned access in nla_get_be64() This patch fixes a unaligned access in nla_get_be64() that was introduced by myself in a17c859849402315613a0015ac8fbf101acf0cc1. Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller --- diff --git a/include/net/netlink.h b/include/net/netlink.h index f82e463..4fc05b5 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h @@ -945,7 +945,11 @@ static inline u64 nla_get_u64(const struct nlattr *nla) */ static inline __be64 nla_get_be64(const struct nlattr *nla) { - return *(__be64 *) nla_data(nla); + __be64 tmp; + + nla_memcpy(&tmp, nla, sizeof(tmp)); + + return tmp; } /**