aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/xt_TEE.c
diff options
context:
space:
mode:
authorGao Feng <fgao@ikuai8.com>2016-09-09 23:25:09 +0800
committerPablo Neira Ayuso <pablo@netfilter.org>2016-09-12 19:54:43 +0200
commit4e6577de71803142d01e374cf15664af0388799a (patch)
tree31cc9b67b0efe071ad9ea072e83dd2fc74c07a3d /net/netfilter/xt_TEE.c
parentcf71c03edf10076f05a0b678fc9c8f8e6c6e24e4 (diff)
downloadlinux-4e6577de71803142d01e374cf15664af0388799a.tar.gz
netfilter: Add the missed return value check of register_netdevice_notifier
There are some codes of netfilter module which did not check the return value of register_netdevice_notifier. Add the checks now. Signed-off-by: Gao Feng <fgao@ikuai8.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/xt_TEE.c')
-rw-r--r--net/netfilter/xt_TEE.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c
index 6e57a3966dc57..0471db4032c5e 100644
--- a/net/netfilter/xt_TEE.c
+++ b/net/netfilter/xt_TEE.c
@@ -89,6 +89,8 @@ static int tee_tg_check(const struct xt_tgchk_param *par)
return -EINVAL;
if (info->oif[0]) {
+ int ret;
+
if (info->oif[sizeof(info->oif)-1] != '\0')
return -EINVAL;
@@ -101,7 +103,11 @@ static int tee_tg_check(const struct xt_tgchk_param *par)
priv->notifier.notifier_call = tee_netdev_event;
info->priv = priv;
- register_netdevice_notifier(&priv->notifier);
+ ret = register_netdevice_notifier(&priv->notifier);
+ if (ret) {
+ kfree(priv);
+ return ret;
+ }
} else
info->priv = NULL;