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
1bd0f7f4
Commit
1bd0f7f4
authored
Mar 31, 2003
by
James Morris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Fix xfrm_state refcounts.
parent
0498603b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
net/xfrm/xfrm_state.c
net/xfrm/xfrm_state.c
+18
-1
No files found.
net/xfrm/xfrm_state.c
View file @
1bd0f7f4
...
...
@@ -176,10 +176,27 @@ static void __xfrm_state_delete(struct xfrm_state *x)
spin_unlock
(
&
xfrm_state_lock
);
if
(
del_timer
(
&
x
->
timer
))
atomic_dec
(
&
x
->
refcnt
);
if
(
atomic_read
(
&
x
->
refcnt
)
!=
1
)
/* The number two in this test is the reference
* mentioned in the comment below plus the reference
* our caller holds. A larger value means that
* there are DSTs attached to this xfrm_state.
*/
if
(
atomic_read
(
&
x
->
refcnt
)
>
2
)
xfrm_flush_bundles
(
x
);
}
/* All xfrm_state objects are created by one of two possible
* paths:
*
* 1) xfrm_state_alloc --> xfrm_state_insert
* 2) xfrm_state_lookup --> xfrm_state_insert
*
* The xfrm_state_lookup or xfrm_state_alloc call gives a
* reference, and that is what we are dropping here.
*/
atomic_dec
(
&
x
->
refcnt
);
if
(
kill
&&
x
->
type
)
x
->
type
->
destructor
(
x
);
wake_up
(
&
km_waitq
);
...
...
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