Thread (19 messages) flat view 19 messages, 6 authors, 2017-01-18

Re: [PATCH net-next v4 1/2] net sched actions: Add support for user cookies

From: Cong Wang <hidden>
Date: 2017-01-17 18:42:29

On Tue, Jan 17, 2017 at 3:11 AM, Jamal Hadi Salim [off-list ref] wrote:
quoted hunk ↗ jump to hunk
@@ -575,6 +583,23 @@ struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
        if (err < 0)
                goto err_mod;

+       if (tb[TCA_ACT_COOKIE]) {
+               if (nla_len(tb[TCA_ACT_COOKIE]) > TC_COOKIE_MAX_SIZE) {
+                       err = -EINVAL;
+                       goto err_mod;
+               }
+
+               a->act_ck = kzalloc(sizeof(*a->act_ck), GFP_KERNEL);
+               if (unlikely(!a->act_ck)) {
+                       err = -ENOMEM;
+                       goto err_mod;
+               }
+
I am afraid you can't just goto err_mod for error case here, b/c ->init()
is already called before this, you probably either have to call ->destroy()
for error path, or move this before ->init().
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help