Bluetooth: Add BUILD_BUG_ON for size of struct sockaddr_rc
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 11 Jan 2015 23:18:20 +0000 (15:18 -0800)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 12 Jan 2015 09:24:21 +0000 (11:24 +0200)
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>
net/bluetooth/rfcomm/sock.c

index 2348176401a0b19ad3b5e9129999381f43da50a0..d8a95755a8a89e2ab99c22b16ea56f339c8229b9 100644 (file)
@@ -1058,6 +1058,8 @@ int __init rfcomm_init_sockets(void)
 {
        int err;
 
+       BUILD_BUG_ON(sizeof(struct sockaddr_rc) > sizeof(struct sockaddr));
+
        err = proto_register(&rfcomm_proto, 0);
        if (err < 0)
                return err;