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
nexedi
linux
Commits
a3e292a1
Commit
a3e292a1
authored
Jan 10, 2004
by
Alexander Viro
Committed by
Stephen Hemminger
Jan 10, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[netdrvr ns83820] Plugs the races around too early register_netdev()
parent
242dd02e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
drivers/net/ns83820.c
drivers/net/ns83820.c
+23
-3
No files found.
drivers/net/ns83820.c
View file @
a3e292a1
...
@@ -1858,9 +1858,17 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
...
@@ -1858,9 +1858,17 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
goto
out_disable
;
goto
out_disable
;
}
}
err
=
register_netdev
(
ndev
);
/*
if
(
err
)
{
* FIXME: we are holding rtnl_lock() over obscenely long area only
printk
(
KERN_INFO
"ns83820: unable to register netdev: %d
\n
"
,
err
);
* because some of the setup code uses dev->name. It's Wrong(tm) -
* we should be using driver-specific names for all that stuff.
* For now that will do, but we really need to come back and kill
* most of the dev_alloc_name() users later.
*/
rtnl_lock
();
err
=
dev_alloc_name
(
ndev
,
ndev
->
name
);
if
(
err
<
0
)
{
printk
(
KERN_INFO
"ns83820: unable to get netdev name: %d
\n
"
,
err
);
goto
out_free_irq
;
goto
out_free_irq
;
}
}
...
@@ -2045,9 +2053,21 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
...
@@ -2045,9 +2053,21 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
ns83820_probe_phy
(
ndev
);
ns83820_probe_phy
(
ndev
);
#endif
#endif
err
=
register_netdevice
(
ndev
);
if
(
err
)
{
printk
(
KERN_INFO
"ns83820: unable to register netdev: %d
\n
"
,
err
);
goto
out_cleanup
;
}
rtnl_unlock
();
return
0
;
return
0
;
out_cleanup:
writel
(
0
,
dev
->
base
+
IMR
);
/* paranoia */
writel
(
0
,
dev
->
base
+
IER
);
readl
(
dev
->
base
+
IER
);
out_free_irq:
out_free_irq:
rtnl_unlock
();
free_irq
(
pci_dev
->
irq
,
ndev
);
free_irq
(
pci_dev
->
irq
,
ndev
);
out_disable:
out_disable:
if
(
dev
->
base
)
if
(
dev
->
base
)
...
...
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