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
1db75d47
Commit
1db75d47
authored
Feb 13, 2003
by
Jochen Friedrich
Committed by
Jeff Garzik
Feb 13, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tokenring madgemc] fix mem leaks, add proper refcounting
parent
79a79c6c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
drivers/net/tokenring/madgemc.c
drivers/net/tokenring/madgemc.c
+22
-5
No files found.
drivers/net/tokenring/madgemc.c
View file @
1db75d47
...
...
@@ -180,8 +180,11 @@ int __init madgemc_probe(void)
if
((
dev
=
init_trdev
(
NULL
,
0
))
==
NULL
)
{
printk
(
"madgemc: unable to allocate dev space
\n
"
);
if
(
madgemc_card_list
)
return
0
;
return
-
1
;
}
SET_MODULE_OWNER
(
dev
);
dev
->
dma
=
0
;
/*
...
...
@@ -193,6 +196,9 @@ int __init madgemc_probe(void)
card
=
kmalloc
(
sizeof
(
struct
madgemc_card
),
GFP_KERNEL
);
if
(
card
==
NULL
)
{
printk
(
"madgemc: unable to allocate card struct
\n
"
);
kfree
(
dev
);
/* release_trdev? */
if
(
madgemc_card_list
)
return
0
;
return
-
1
;
}
card
->
dev
=
dev
;
...
...
@@ -223,14 +229,14 @@ int __init madgemc_probe(void)
if
(
dev
->
irq
==
0
)
{
printk
(
"%s: invalid IRQ
\n
"
,
dev
->
name
);
goto
getout
;
goto
getout
1
;
}
if
(
!
request_region
(
dev
->
base_addr
,
MADGEMC_IO_EXTENT
,
"madgemc"
))
{
printk
(
KERN_INFO
"madgemc: unable to setup Smart MC in slot %d because of I/O base conflict at 0x%04lx
\n
"
,
slot
,
dev
->
base_addr
);
dev
->
base_addr
+=
MADGEMC_SIF_OFFSET
;
goto
getout
;
goto
getout
1
;
}
dev
->
base_addr
+=
MADGEMC_SIF_OFFSET
;
...
...
@@ -348,6 +354,14 @@ int __init madgemc_probe(void)
if
(
tmsdev_init
(
dev
,
ISA_MAX_ADDRESS
,
NULL
))
{
printk
(
"%s: unable to get memory for dev->priv.
\n
"
,
dev
->
name
);
release_region
(
dev
->
base_addr
-
MADGEMC_SIF_OFFSET
,
MADGEMC_IO_EXTENT
);
kfree
(
card
);
tmsdev_term
(
dev
);
kfree
(
dev
);
if
(
madgemc_card_list
)
return
0
;
return
-
1
;
}
tp
=
(
struct
net_local
*
)
dev
->
priv
;
...
...
@@ -376,10 +390,14 @@ int __init madgemc_probe(void)
madgemc_card_list
=
card
;
}
else
{
printk
(
"madgemc: register_trdev() returned non-zero.
\n
"
);
release_region
(
dev
->
base_addr
-
MADGEMC_SIF_OFFSET
,
MADGEMC_IO_EXTENT
);
kfree
(
card
);
tmsdev_term
(
dev
);
kfree
(
dev
);
if
(
madgemc_card_list
)
return
0
;
return
-
1
;
}
...
...
@@ -389,6 +407,7 @@ int __init madgemc_probe(void)
getout:
release_region
(
dev
->
base_addr
-
MADGEMC_SIF_OFFSET
,
MADGEMC_IO_EXTENT
);
getout1:
kfree
(
card
);
kfree
(
dev
);
/* release_trdev? */
slot
++
;
...
...
@@ -696,7 +715,6 @@ static int madgemc_open(struct net_device *dev)
*/
madgemc_chipset_init
(
dev
);
tms380tr_open
(
dev
);
MOD_INC_USE_COUNT
;
return
0
;
}
...
...
@@ -704,7 +722,6 @@ static int madgemc_close(struct net_device *dev)
{
tms380tr_close
(
dev
);
madgemc_chipset_close
(
dev
);
MOD_DEC_USE_COUNT
;
return
0
;
}
...
...
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