diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-01-11 15:18:19 -0800 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-01-12 11:24:19 +0200 |
commit | dd6255588a56e755380b66275ff4f35a8243b64a (patch) | |
tree | 12e013ee372bb851f8536eff36c9781749f7de30 | |
parent | b0a8e282b54d11859a13bebd4c056dcfb577f8b7 (diff) | |
download | linux-stable-dd6255588a56e755380b66275ff4f35a8243b64a.tar.gz linux-stable-dd6255588a56e755380b66275ff4f35a8243b64a.tar.bz2 linux-stable-dd6255588a56e755380b66275ff4f35a8243b64a.zip |
Bluetooth: Add BUILD_BUG_ON for size of struct sockaddr_l2
This adds an extra check for ensuring that the size of sockaddr_l2
does not grow larger than sockaddr.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index f65caf41953f..20206cd3acbc 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -1614,6 +1614,8 @@ int __init l2cap_init_sockets(void) { int err; + BUILD_BUG_ON(sizeof(struct sockaddr_l2) > sizeof(struct sockaddr)); + err = proto_register(&l2cap_proto, 0); if (err < 0) return err; |