diff --git a/net/core/sockev_nlmcast.c b/net/core/sockev_nlmcast.c index 0b934d578d0b..7741f1f107cd 100644 --- a/net/core/sockev_nlmcast.c +++ b/net/core/sockev_nlmcast.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -75,6 +75,9 @@ static int sockev_client_cb(struct notifier_block *nb, if ((socknlmsgsk == NULL) || (sock == NULL) || (sock->sk == NULL)) goto done; + if (sock->sk->sk_family != AF_INET || sock->sk->sk_family != AF_INET6) + goto done; + skb = nlmsg_new(sizeof(struct sknlsockevmsg), GFP_KERNEL); if (skb == NULL) goto done;