Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3add94a5
Commit
3add94a5
authored
Apr 09, 2003
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[VLAN]: More device registry error handling fixes.
parent
b1d7a6ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
net/8021q/vlan.c
net/8021q/vlan.c
+14
-11
No files found.
net/8021q/vlan.c
View file @
3add94a5
...
...
@@ -501,6 +501,15 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
real_dev
->
ifindex
);
#endif
if
(
register_netdevice
(
new_dev
))
goto
out_free_newdev_priv
;
/* NOTE: We have a reference to the real device,
* so hold on to the reference. May fail if we are being removed
*/
if
(
!
try_module_get
(
THIS_MODULE
))
goto
out_free_unregister
;
/* So, got the sucker initialized, now lets place
* it into our local structure.
*/
...
...
@@ -514,7 +523,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
if
(
!
grp
)
{
/* need to add a new group */
grp
=
kmalloc
(
sizeof
(
struct
vlan_group
),
GFP_KERNEL
);
if
(
!
grp
)
goto
out_free_
newdev_priv
;
goto
out_free_
put
;
/* printk(KERN_ALERT "VLAN REGISTER: Allocated new group.\n"); */
memset
(
grp
,
0
,
sizeof
(
struct
vlan_group
));
...
...
@@ -535,24 +544,18 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
if
(
real_dev
->
features
&
NETIF_F_HW_VLAN_FILTER
)
real_dev
->
vlan_rx_add_vid
(
real_dev
,
VLAN_ID
);
register_netdevice
(
new_dev
);
rtnl_unlock
();
/* NOTE: We have a reference to the real device,
* so hold on to the reference.
*/
if
(
!
try_module_get
(
THIS_MODULE
))
goto
out_module_dying
;
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
"Allocated new device successfully, returning.
\n
"
);
#endif
return
new_dev
;
out_free_put:
module_put
(
THIS_MODULE
);
out_module_dying:
rtnl_lock
();
unregister_netdevice
(
new_dev
);
out_free_unregister:
unregister_netdev
(
new_dev
);
out_free_newdev_priv:
kfree
(
new_dev
->
priv
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment