@@ -1861,7 +1861,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
1861
1861
vport -> upcall_stats = netdev_alloc_pcpu_stats (struct vport_upcall_stats_percpu );
1862
1862
if (!vport -> upcall_stats ) {
1863
1863
err = - ENOMEM ;
1864
- goto err_destroy_portids ;
1864
+ goto err_destroy_vport ;
1865
1865
}
1866
1866
1867
1867
err = ovs_dp_cmd_fill_info (dp , reply , info -> snd_portid ,
@@ -1876,6 +1876,8 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
1876
1876
ovs_notify (& dp_datapath_genl_family , reply , info );
1877
1877
return 0 ;
1878
1878
1879
+ err_destroy_vport :
1880
+ ovs_dp_detach_port (vport );
1879
1881
err_destroy_portids :
1880
1882
kfree (rcu_dereference_raw (dp -> upcall_portids ));
1881
1883
err_unlock_and_destroy_meters :
@@ -2323,7 +2325,7 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
2323
2325
vport -> upcall_stats = netdev_alloc_pcpu_stats (struct vport_upcall_stats_percpu );
2324
2326
if (!vport -> upcall_stats ) {
2325
2327
err = - ENOMEM ;
2326
- goto exit_unlock_free ;
2328
+ goto exit_unlock_free_vport ;
2327
2329
}
2328
2330
2329
2331
err = ovs_vport_cmd_fill_info (vport , reply , genl_info_net (info ),
@@ -2343,6 +2345,8 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
2343
2345
ovs_notify (& dp_vport_genl_family , reply , info );
2344
2346
return 0 ;
2345
2347
2348
+ exit_unlock_free_vport :
2349
+ ovs_dp_detach_port (vport );
2346
2350
exit_unlock_free :
2347
2351
ovs_unlock ();
2348
2352
kfree_skb (reply );
0 commit comments