Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ea3b446 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

net: sched: cls: use nla_nest_cancel instead of nlmsg_trim



To cancel nesting, this function is more convenient.

Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f9c5c62d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -177,7 +177,6 @@ static int cls_cgroup_dump(struct net *net, struct tcf_proto *tp, unsigned long
			   struct sk_buff *skb, struct tcmsg *t)
{
	struct cls_cgroup_head *head = rtnl_dereference(tp->root);
	unsigned char *b = skb_tail_pointer(skb);
	struct nlattr *nest;

	t->tcm_handle = head->handle;
@@ -198,7 +197,7 @@ static int cls_cgroup_dump(struct net *net, struct tcf_proto *tp, unsigned long
	return skb->len;

nla_put_failure:
	nlmsg_trim(skb, b);
	nla_nest_cancel(skb, nest);
	return -1;
}

+1 −1
Original line number Diff line number Diff line
@@ -638,7 +638,7 @@ static int flow_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
	return skb->len;

nla_put_failure:
	nlmsg_trim(skb, nest);
	nla_nest_cancel(skb, nest);
	return -1;
}

+1 −2
Original line number Diff line number Diff line
@@ -356,7 +356,6 @@ static int fw_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
{
	struct fw_head *head = rtnl_dereference(tp->root);
	struct fw_filter *f = (struct fw_filter *)fh;
	unsigned char *b = skb_tail_pointer(skb);
	struct nlattr *nest;

	if (f == NULL)
@@ -397,7 +396,7 @@ static int fw_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
	return skb->len;

nla_put_failure:
	nlmsg_trim(skb, b);
	nla_nest_cancel(skb, nest);
	return -1;
}

+1 −2
Original line number Diff line number Diff line
@@ -593,7 +593,6 @@ static int route4_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
		       struct sk_buff *skb, struct tcmsg *t)
{
	struct route4_filter *f = (struct route4_filter *)fh;
	unsigned char *b = skb_tail_pointer(skb);
	struct nlattr *nest;
	u32 id;

@@ -635,7 +634,7 @@ static int route4_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
	return skb->len;

nla_put_failure:
	nlmsg_trim(skb, b);
	nla_nest_cancel(skb, nest);
	return -1;
}

+1 −2
Original line number Diff line number Diff line
@@ -653,7 +653,6 @@ static int rsvp_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
{
	struct rsvp_filter *f = (struct rsvp_filter *)fh;
	struct rsvp_session *s;
	unsigned char *b = skb_tail_pointer(skb);
	struct nlattr *nest;
	struct tc_rsvp_pinfo pinfo;

@@ -694,7 +693,7 @@ static int rsvp_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
	return skb->len;

nla_put_failure:
	nlmsg_trim(skb, b);
	nla_nest_cancel(skb, nest);
	return -1;
}

Loading