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
f55c3d5c
Commit
f55c3d5c
authored
Jun 18, 2003
by
Kai Germaschewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ISDN: Make PPP compressors unload-safe.
Remove MOD_{INC,DEC}_USE_COUNT and introduce .owner instead.
parent
0f36c6e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
drivers/isdn/i4l/isdn_bsdcomp.c
drivers/isdn/i4l/isdn_bsdcomp.c
+1
-3
drivers/isdn/i4l/isdn_ppp_ccp.c
drivers/isdn/i4l/isdn_ppp_ccp.c
+17
-5
include/linux/isdn_ppp.h
include/linux/isdn_ppp.h
+1
-0
No files found.
drivers/isdn/i4l/isdn_bsdcomp.c
View file @
f55c3d5c
...
...
@@ -300,7 +300,6 @@ static void bsd_free (void *state)
* Finally release the structure itself.
*/
kfree
(
db
);
MOD_DEC_USE_COUNT
;
}
}
...
...
@@ -355,8 +354,6 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data)
return
NULL
;
}
MOD_INC_USE_COUNT
;
/*
* If this is the compression buffer then there is no length data.
* For decompression, the length information is needed as well.
...
...
@@ -907,6 +904,7 @@ static int bsd_decompress (void *state, struct sk_buff *skb_in, struct sk_buff *
*************************************************************/
static
struct
isdn_ppp_compressor
ippp_bsd_compress
=
{
.
owner
=
THIS_MODULE
,
.
num
=
CI_BSD_COMPRESS
,
.
alloc
=
bsd_alloc
,
.
free
=
bsd_free
,
...
...
drivers/isdn/i4l/isdn_ppp_ccp.c
View file @
f55c3d5c
...
...
@@ -259,11 +259,14 @@ ippp_ccp_free(struct ippp_ccp *ccp)
{
int
id
;
if
(
ccp
->
comp_stat
)
if
(
ccp
->
comp_stat
)
{
ccp
->
compressor
->
free
(
ccp
->
comp_stat
);
if
(
ccp
->
decomp_stat
)
module_put
(
ccp
->
compressor
->
owner
);
}
if
(
ccp
->
decomp_stat
)
{
ccp
->
decompressor
->
free
(
ccp
->
decomp_stat
);
module_put
(
ccp
->
decompressor
->
owner
);
}
for
(
id
=
0
;
id
<
256
;
id
++
)
{
if
(
ccp
->
reset
->
rs
[
id
])
ippp_ccp_reset_free_state
(
ccp
,
id
);
...
...
@@ -572,25 +575,34 @@ ippp_ccp_set_compressor(struct ippp_ccp *ccp, int unit,
if
(
ipc
->
num
!=
num
)
continue
;
if
(
!
try_module_get
(
ipc
->
owner
))
continue
;
stat
=
ipc
->
alloc
(
data
);
if
(
!
stat
)
{
printk
(
KERN_ERR
"Can't alloc (de)compression!
\n
"
);
module_put
(
ipc
->
owner
);
break
;
}
ret
=
ipc
->
init
(
stat
,
data
,
unit
,
0
);
if
(
!
ret
)
{
printk
(
KERN_ERR
"Can't init (de)compression!
\n
"
);
ipc
->
free
(
stat
);
module_put
(
ipc
->
owner
);
break
;
}
if
(
data
->
flags
&
IPPP_COMP_FLAG_XMIT
)
{
if
(
ccp
->
comp_stat
)
if
(
ccp
->
comp_stat
)
{
ccp
->
compressor
->
free
(
ccp
->
comp_stat
);
module_put
(
ccp
->
compressor
->
owner
);
}
ccp
->
comp_stat
=
stat
;
ccp
->
compressor
=
ipc
;
}
else
{
if
(
ccp
->
decomp_stat
)
if
(
ccp
->
decomp_stat
)
{
ccp
->
decompressor
->
free
(
ccp
->
decomp_stat
);
module_put
(
ccp
->
decompressor
->
owner
);
}
ccp
->
decomp_stat
=
stat
;
ccp
->
decompressor
=
ipc
;
}
...
...
include/linux/isdn_ppp.h
View file @
f55c3d5c
...
...
@@ -95,6 +95,7 @@ struct isdn_ppp_resetparams {
* check the original include for more information
*/
struct
isdn_ppp_compressor
{
struct
module
*
owner
;
struct
isdn_ppp_compressor
*
next
,
*
prev
;
int
num
;
/* CCP compression protocol number */
...
...
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