diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-01-11 18:18:20 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-01-12 04:24:21 -0500 |
commit | 74b3fb8d0daf150eeb66665897601fb10c024687 (patch) | |
tree | f9b0725273c2ff9cd3a3e44abdc5b26a1af77734 /net | |
parent | dd6255588a56e755380b66275ff4f35a8243b64a (diff) |
Bluetooth: Add BUILD_BUG_ON for size of struct sockaddr_rc
This adds an extra check for ensuring that the size of sockaddr_rc
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')
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index 2348176401a0..d8a95755a8a8 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -1058,6 +1058,8 @@ int __init rfcomm_init_sockets(void) | |||
1058 | { | 1058 | { |
1059 | int err; | 1059 | int err; |
1060 | 1060 | ||
1061 | BUILD_BUG_ON(sizeof(struct sockaddr_rc) > sizeof(struct sockaddr)); | ||
1062 | |||
1061 | err = proto_register(&rfcomm_proto, 0); | 1063 | err = proto_register(&rfcomm_proto, 0); |
1062 | if (err < 0) | 1064 | if (err < 0) |
1063 | return err; | 1065 | return err; |