Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199211
b: refs/heads/master
c: 8ca9418
h: refs/heads/master
i:
  199209: 03bfd16
  199207: a9c093b
v: v3
  • Loading branch information
Scott Feldman authored and David S. Miller committed May 28, 2010
1 parent cc59d77 commit 08e1003
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50636af715ac1ceb1872bd29a4bdcc68975c3263
refs/heads/master: 8ca9418350eccd5dd2659931807c1901224dd638
15 changes: 9 additions & 6 deletions trunk/net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,14 +722,13 @@ static int rtnl_vf_ports_fill(struct sk_buff *skb, struct net_device *dev)

for (vf = 0; vf < dev_num_vf(dev->dev.parent); vf++) {
vf_port = nla_nest_start(skb, IFLA_VF_PORT);
if (!vf_port) {
nla_nest_cancel(skb, vf_ports);
return -EMSGSIZE;
}
if (!vf_port)
goto nla_put_failure;
NLA_PUT_U32(skb, IFLA_PORT_VF, vf);
err = dev->netdev_ops->ndo_get_vf_port(dev, vf, skb);
if (err == -EMSGSIZE)
goto nla_put_failure;
if (err) {
nla_put_failure:
nla_nest_cancel(skb, vf_port);
continue;
}
Expand All @@ -739,6 +738,10 @@ static int rtnl_vf_ports_fill(struct sk_buff *skb, struct net_device *dev)
nla_nest_end(skb, vf_ports);

return 0;

nla_put_failure:
nla_nest_cancel(skb, vf_ports);
return -EMSGSIZE;
}

static int rtnl_port_self_fill(struct sk_buff *skb, struct net_device *dev)
Expand All @@ -753,7 +756,7 @@ static int rtnl_port_self_fill(struct sk_buff *skb, struct net_device *dev)
err = dev->netdev_ops->ndo_get_vf_port(dev, PORT_SELF_VF, skb);
if (err) {
nla_nest_cancel(skb, port_self);
return err;
return (err == -EMSGSIZE) ? err : 0;
}

nla_nest_end(skb, port_self);
Expand Down

0 comments on commit 08e1003

Please sign in to comment.