diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-01-11 18:18:17 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-01-12 04:24:16 -0500 |
commit | b0a8e282b54d11859a13bebd4c056dcfb577f8b7 (patch) | |
tree | 0867f184ddce711c36886e386f0e6c1edf4d25f5 /net/bluetooth | |
parent | 1904a853fae40ee61bed7c231fc5bd2158984441 (diff) |
Bluetooth: Add BUILD_BUG_ON for size of struct sockaddr_hci
This adds an extra check for ensuring that the size of sockaddr_hci
does not grow larger than sockaddr.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_sock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 2c245fdf319a..e176a988625e 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -1230,6 +1230,8 @@ int __init hci_sock_init(void) | |||
1230 | { | 1230 | { |
1231 | int err; | 1231 | int err; |
1232 | 1232 | ||
1233 | BUILD_BUG_ON(sizeof(struct sockaddr_hci) > sizeof(struct sockaddr)); | ||
1234 | |||
1233 | err = proto_register(&hci_sk_proto, 0); | 1235 | err = proto_register(&hci_sk_proto, 0); |
1234 | if (err < 0) | 1236 | if (err < 0) |
1235 | return err; | 1237 | return err; |