]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[BLUETOOTH]: Fix unaligned access in hci_send_to_sock.
authorDavid S. Miller <davem@davemloft.net>
Wed, 22 Nov 2006 00:17:41 +0000 (16:17 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Nov 2006 00:17:41 +0000 (16:17 -0800)
The "u16 *" derefs of skb->data need to be wrapped inside of
a get_unaligned().

Thanks to Gustavo Zacarias for the bug report.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/bluetooth/hci_sock.c

index f26a9eb49945c8805db60c07964b9c1a734f4556..711a085eca5b3436bc13e528a7b03904f74beba2 100644 (file)
@@ -120,10 +120,13 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
                        if (!hci_test_bit(evt, &flt->event_mask))
                                continue;
 
-                       if (flt->opcode && ((evt == HCI_EV_CMD_COMPLETE && 
-                                       flt->opcode != *(__u16 *)(skb->data + 3)) ||
-                                       (evt == HCI_EV_CMD_STATUS && 
-                                       flt->opcode != *(__u16 *)(skb->data + 4))))
+                       if (flt->opcode &&
+                           ((evt == HCI_EV_CMD_COMPLETE &&
+                             flt->opcode !=
+                             get_unaligned((__u16 *)(skb->data + 3))) ||
+                            (evt == HCI_EV_CMD_STATUS &&
+                             flt->opcode !=
+                             get_unaligned((__u16 *)(skb->data + 4)))))
                                continue;
                }