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
074821d5
Commit
074821d5
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 sgiseeq] alloc_etherdev, SET_MODULE_OWNER, fix leaks on error
parent
5e2221c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
drivers/net/sgiseeq.c
drivers/net/sgiseeq.c
+20
-9
No files found.
drivers/net/sgiseeq.c
View file @
074821d5
...
...
@@ -600,6 +600,7 @@ int sgiseeq_init(struct hpc3_regs* regs, int irq)
{
struct
net_device
*
dev
;
struct
sgiseeq_private
*
sp
;
int
err
=
-
ENOMEM
;
int
i
;
sp
=
(
struct
sgiseeq_private
*
)
get_zeroed_page
(
GFP_KERNEL
);
...
...
@@ -609,19 +610,17 @@ int sgiseeq_init(struct hpc3_regs* regs, int irq)
return
-
ENOMEM
;
}
dev
=
init_etherdev
(
NULL
,
0
);
dev
=
alloc_etherdev
(
0
);
if
(
!
dev
)
{
printk
(
KERN_ERR
"Seeq8003: Could not allocate memory for device.
\n
"
);
free_page
((
unsigned
long
)
sp
);
return
-
ENOMEM
;
goto
out
;
}
if
(
request_irq
(
irq
,
sgiseeq_interrupt
,
0
,
sgiseeqstr
,
dev
))
{
printk
(
KERN_ERR
"Seeq8003: Can't get irq %d
\n
"
,
dev
->
irq
);
free_page
((
unsigned
long
)
sp
);
unregister_netdev
(
dev
);
return
-
EAGAIN
;
printk
(
KERN_ERR
"Seeq8003: Can't get irq %d
\n
"
,
irq
);
err
=
-
EAGAIN
;
goto
out1
;
}
printk
(
KERN_INFO
"%s: SGI Seeq8003 "
,
dev
->
name
);
...
...
@@ -637,6 +636,8 @@ int sgiseeq_init(struct hpc3_regs* regs, int irq)
}
printk
(
"
\n
"
);
SET_MODULE_OWNER
(
dev
);
dev
->
priv
=
sp
;
#ifdef DEBUG
gpriv
=
sp
;
...
...
@@ -677,12 +678,22 @@ int sgiseeq_init(struct hpc3_regs* regs, int irq)
dev
->
set_multicast_list
=
sgiseeq_set_multicast
;
dev
->
irq
=
irq
;
dev
->
dma
=
0
;
ether_setup
(
dev
);
err
=
register_netdev
(
dev
);
if
(
err
)
goto
out2
;
sp
->
next_module
=
root_sgiseeq_dev
;
root_sgiseeq_dev
=
dev
;
return
0
;
out2:
free_irq
(
dev
->
irq
,
dev
);
out1:
free_netdev
(
dev
);
out:
free_page
((
unsigned
long
)
sp
);
return
err
;
}
static
int
__init
sgiseeq_probe
(
void
)
...
...
@@ -701,9 +712,9 @@ static void __exit sgiseeq_exit(void)
while
(
dev
)
{
sp
=
(
struct
sgiseeq_private
*
)
dev
->
priv
;
next
=
sp
->
next_module
;
unregister_netdev
(
dev
);
free_irq
(
dev
->
irq
,
dev
);
free_page
((
unsigned
long
)
sp
);
unregister_netdev
(
dev
);
free_netdev
(
dev
);
dev
=
next
;
}
...
...
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