OSDN Git Service

net/sched: fix idr leak in the error path of tcf_skbmod_init()
[tomoyo/tomoyo-test1.git] / net / sched / act_skbmod.c
index d09565d..7b0700f 100644 (file)
@@ -152,7 +152,7 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla,
        ASSERT_RTNL();
        p = kzalloc(sizeof(struct tcf_skbmod_params), GFP_KERNEL);
        if (unlikely(!p)) {
-               if (ovr)
+               if (ret == ACT_P_CREATED)
                        tcf_idr_release(*a, bind);
                return -ENOMEM;
        }