Message ID | 20230315233626.935873-2-cengiz.can@canonical.com |
---|---|
State | New |
Headers | show |
Series | CVE-2023-26545 | expand |
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index b52afe316dc4..f1f43894efb8 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c @@ -1428,6 +1428,7 @@ static int mpls_dev_sysctl_register(struct net_device *dev, free: kfree(table); out: + mdev->sysctl = NULL; return -ENOBUFS; } @@ -1437,6 +1438,9 @@ static void mpls_dev_sysctl_unregister(struct net_device *dev, struct net *net = dev_net(dev); struct ctl_table *table; + if (!mdev->sysctl) + return; + table = mdev->sysctl->ctl_table_arg; unregister_net_sysctl_table(mdev->sysctl); kfree(table);