summaryrefslogtreecommitdiff
path: root/net/bluetooth/sco.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-01-11 15:21:06 -0800
committerJohan Hedberg <johan.hedberg@intel.com>2015-01-12 11:24:24 +0200
commit15762fa772bf91687e2f2a6afc6df975ee2a6f70 (patch)
tree4d6dc5104c246baa1b3c604f7021e66d25072be7 /net/bluetooth/sco.c
parent74b3fb8d0daf150eeb66665897601fb10c024687 (diff)
Bluetooth: Add BUILD_BUG_ON for size of struct sockaddr_sco
This adds an extra check for ensuring that the size of sockaddr_sco 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/sco.c')
-rw-r--r--net/bluetooth/sco.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 30e5ea3f1ad3..07ec7d23b843 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -1184,6 +1184,8 @@ int __init sco_init(void)
{
int err;
+ BUILD_BUG_ON(sizeof(struct sockaddr_sco) > sizeof(struct sockaddr));
+
err = proto_register(&sco_proto, 0);
if (err < 0)
return err;