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
1c00c05b
Commit
1c00c05b
authored
Dec 11, 2003
by
Alexander Viro
Committed by
David S. Miller
Dec 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Fix missing netdev unregister/free in netrom and rose protocols.
Also, fix a object size vs. pointer size thinko.
parent
96828577
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
19 deletions
+21
-19
net/netrom/af_netrom.c
net/netrom/af_netrom.c
+8
-3
net/netrom/nr_dev.c
net/netrom/nr_dev.c
+0
-1
net/rose/af_rose.c
net/rose/af_rose.c
+13
-15
No files found.
net/netrom/af_netrom.c
View file @
1c00c05b
...
...
@@ -1377,7 +1377,7 @@ static int __init nr_proto_init(void)
{
int
i
;
if
(
nr_ndevs
>
0x7fffffff
/
sizeof
(
struct
net_device
))
{
if
(
nr_ndevs
>
0x7fffffff
/
sizeof
(
struct
net_device
*
))
{
printk
(
KERN_ERR
"NET/ROM: nr_proto_init - nr_ndevs parameter to large
\n
"
);
return
-
1
;
}
...
...
@@ -1405,6 +1405,7 @@ static int __init nr_proto_init(void)
dev
->
base_addr
=
i
;
if
(
register_netdev
(
dev
))
{
printk
(
KERN_ERR
"NET/ROM: nr_proto_init - unable to register network device
\n
"
);
free_netdev
(
dev
);
goto
fail
;
}
dev_nr
[
i
]
=
dev
;
...
...
@@ -1433,8 +1434,10 @@ static int __init nr_proto_init(void)
return
0
;
fail:
while
(
--
i
>=
0
)
while
(
--
i
>=
0
)
{
unregister_netdev
(
dev_nr
[
i
]);
free_netdev
(
dev_nr
[
i
]);
}
kfree
(
dev_nr
);
return
-
1
;
}
...
...
@@ -1474,8 +1477,10 @@ static void __exit nr_exit(void)
for
(
i
=
0
;
i
<
nr_ndevs
;
i
++
)
{
struct
net_device
*
dev
=
dev_nr
[
i
];
if
(
dev
)
if
(
dev
)
{
unregister_netdev
(
dev
);
free_netdev
(
dev
);
}
}
kfree
(
dev_nr
);
...
...
net/netrom/nr_dev.c
View file @
1c00c05b
...
...
@@ -204,7 +204,6 @@ void nr_setup(struct net_device *dev)
dev
->
hard_start_xmit
=
nr_xmit
;
dev
->
open
=
nr_open
;
dev
->
stop
=
nr_close
;
dev
->
destructor
=
free_netdev
;
dev
->
hard_header
=
nr_header
;
dev
->
hard_header_len
=
NR_NETWORK_LEN
+
NR_TRANSPORT_LEN
;
...
...
net/rose/af_rose.c
View file @
1c00c05b
...
...
@@ -1481,7 +1481,7 @@ static int __init rose_proto_init(void)
rose_callsign
=
null_ax25_address
;
if
(
rose_ndevs
>
0x7FFFFFFF
/
sizeof
(
struct
net_device
))
{
if
(
rose_ndevs
>
0x7FFFFFFF
/
sizeof
(
struct
net_device
*
))
{
printk
(
KERN_ERR
"ROSE: rose_proto_init - rose_ndevs parameter to large
\n
"
);
return
-
1
;
}
...
...
@@ -1502,23 +1502,14 @@ static int __init rose_proto_init(void)
name
,
rose_setup
);
if
(
!
dev
)
{
printk
(
KERN_ERR
"ROSE: rose_proto_init - unable to allocate memory
\n
"
);
while
(
--
i
>=
0
)
kfree
(
dev_rose
[
i
]);
return
-
ENOMEM
;
}
dev_rose
[
i
]
=
dev
;
goto
fail
;
}
for
(
i
=
0
;
i
<
rose_ndevs
;
i
++
)
{
if
(
register_netdev
(
dev_rose
[
i
]))
{
if
(
register_netdev
(
dev
))
{
printk
(
KERN_ERR
"ROSE: netdevice regeistration failed
\n
"
);
while
(
--
i
>=
0
)
{
unregister_netdev
(
dev_rose
[
i
]);
kfree
(
dev_rose
[
i
]);
return
-
EIO
;
}
free_netdev
(
dev
);
goto
fail
;
}
dev_rose
[
i
]
=
dev
;
}
sock_register
(
&
rose_family_ops
);
...
...
@@ -1541,6 +1532,13 @@ static int __init rose_proto_init(void)
proc_net_fops_create
(
"rose_routes"
,
S_IRUGO
,
&
rose_routes_fops
);
return
0
;
fail:
while
(
--
i
>=
0
)
{
unregister_netdev
(
dev_rose
[
i
]);
free_netdev
(
dev_rose
[
i
]);
}
kfree
(
dev_rose
);
return
-
ENOMEM
;
}
module_init
(
rose_proto_init
);
...
...
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