string: factorize skip_spaces and export it to be generally available
[safe/jmp/linux-2.6] / net / sched / act_ipt.c
index a54dc3f..082c520 100644 (file)
@@ -55,9 +55,9 @@ static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int
        par.target    = target;
        par.targinfo  = t->data;
        par.hook_mask = hook;
+       par.family    = NFPROTO_IPV4;
 
-       ret = xt_check_target(&par, NFPROTO_IPV4,
-             t->u.target_size - sizeof(*t), 0, false);
+       ret = xt_check_target(&par, t->u.target_size - sizeof(*t), 0, false);
        if (ret < 0) {
                module_put(t->u.kernel.target->me);
                return ret;
@@ -67,9 +67,13 @@ static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int
 
 static void ipt_destroy_target(struct ipt_entry_target *t)
 {
-       if (t->u.kernel.target->destroy)
-               t->u.kernel.target->destroy(t->u.kernel.target, t->data);
-       module_put(t->u.kernel.target->me);
+       struct xt_tgdtor_param par = {
+               .target   = t->u.kernel.target,
+               .targinfo = t->data,
+       };
+       if (par.target->destroy != NULL)
+               par.target->destroy(&par);
+       module_put(par.target->me);
 }
 
 static int tcf_ipt_release(struct tcf_ipt *ipt, int bind)
@@ -132,8 +136,8 @@ static int tcf_ipt_init(struct nlattr *nla, struct nlattr *est,
        if (!pc) {
                pc = tcf_hash_create(index, est, a, sizeof(*ipt), bind,
                                     &ipt_idx_gen, &ipt_hash_info);
-               if (unlikely(!pc))
-                       return -ENOMEM;
+               if (IS_ERR(pc))
+                   return PTR_ERR(pc);
                ret = ACT_P_CREATED;
        } else {
                if (!ovr) {