@@ -968,7 +968,8 @@ static int get_info(struct net *net, void __user *user,
if (compat) {
ret = compat_table_info(private, &tmp);
- xt_compat_flush_offsets(AF_INET);
+ if (!ret)
+ goto out;
private = &tmp;
}
#endif
@@ -986,14 +987,20 @@ static int get_info(struct net *net, void __user *user,
ret = -EFAULT;
else
ret = 0;
+ } else
+ ret = -ENOENT;
+out:
+ if (t) {
xt_table_unlock(t);
module_put(t->me);
- } else
- ret = -ENOENT;
+ }
+
#ifdef CONFIG_COMPAT
- if (compat)
+ if (compat) {
+ xt_compat_flush_offsets(AF_INET);
xt_compat_unlock(AF_INET);
+ }
#endif
return ret;
}