]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: fix unaligned access to l2cap conf data
authorsteven miao <realmz6@gmail.com>
Sat, 16 Oct 2010 22:29:47 +0000 (18:29 -0400)
committerGustavo F. Padovan <padovan@profusion.mobi>
Tue, 9 Nov 2010 02:56:00 +0000 (00:56 -0200)
commit772ecb9eb977095d45d4980ce75923f2e556f07d
tree8a7a46f99f20d8a637e1867b6309c3e6b88f47da
parent7aae64730fdd084c445b7ecdfbd801a4db9b1a4e
Bluetooth: fix unaligned access to l2cap conf data

In function l2cap_get_conf_opt() and l2cap_add_conf_opt() the address of
opt->val sometimes is not at the edge of 2-bytes/4-bytes, so 2-bytes/4 bytes
access will cause data misalignment exeception.  Use get_unaligned_le16/32
and put_unaligned_le16/32 function to avoid data misalignment execption.

Signed-off-by: steven miao <realmz6@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/l2cap.c