diff options
Diffstat (limited to 'net/openvswitch/vport.c')
-rw-r--r-- | net/openvswitch/vport.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index f6b8132ce4cb..71a2de8726cb 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c | |||
@@ -301,17 +301,19 @@ void ovs_vport_get_stats(struct vport *vport, struct ovs_vport_stats *stats) | |||
301 | int ovs_vport_get_options(const struct vport *vport, struct sk_buff *skb) | 301 | int ovs_vport_get_options(const struct vport *vport, struct sk_buff *skb) |
302 | { | 302 | { |
303 | struct nlattr *nla; | 303 | struct nlattr *nla; |
304 | int err; | ||
305 | |||
306 | if (!vport->ops->get_options) | ||
307 | return 0; | ||
304 | 308 | ||
305 | nla = nla_nest_start(skb, OVS_VPORT_ATTR_OPTIONS); | 309 | nla = nla_nest_start(skb, OVS_VPORT_ATTR_OPTIONS); |
306 | if (!nla) | 310 | if (!nla) |
307 | return -EMSGSIZE; | 311 | return -EMSGSIZE; |
308 | 312 | ||
309 | if (vport->ops->get_options) { | 313 | err = vport->ops->get_options(vport, skb); |
310 | int err = vport->ops->get_options(vport, skb); | 314 | if (err) { |
311 | if (err) { | 315 | nla_nest_cancel(skb, nla); |
312 | nla_nest_cancel(skb, nla); | 316 | return err; |
313 | return err; | ||
314 | } | ||
315 | } | 317 | } |
316 | 318 | ||
317 | nla_nest_end(skb, nla); | 319 | nla_nest_end(skb, nla); |