projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
556ae19
)
macvlan: do proper cleanup in macvlan_common_newlink() V2
author
Jiri Pirko
<
[email protected]
>
Mon, 24 May 2010 07:02:25 +0000
(07:02 +0000)
committer
David S. Miller
<
[email protected]
>
Tue, 25 May 2010 01:42:12 +0000
(18:42 -0700)
Fixes possible memory leak.
Signed-off-by: Jiri Pirko <
[email protected]
>
Acked-by: Patrick McHardy <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/macvlan.c
patch
|
blob
|
history
diff --git
a/drivers/net/macvlan.c
b/drivers/net/macvlan.c
index 4e238afab4a3b999d2e4af9ee178b6d593c4a9ed..87e8d4cb40579a8947419446012b38896b29064c 100644
(file)
--- a/
drivers/net/macvlan.c
+++ b/
drivers/net/macvlan.c
@@
-634,11
+634,18
@@
int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
err = register_netdevice(dev);
if (err < 0)
-
return err
;
+
goto destroy_port
;
list_add_tail(&vlan->list, &port->vlans);
netif_stacked_transfer_operstate(lowerdev, dev);
+
return 0;
+
+destroy_port:
+ if (list_empty(&port->vlans))
+ macvlan_port_destroy(lowerdev);
+
+ return err;
}
EXPORT_SYMBOL_GPL(macvlan_common_newlink);