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>
This commit is contained in:
parent
dd6255588a
commit
74b3fb8d0d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user