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
395ab5d6
Commit
395ab5d6
authored
Jul 28, 2003
by
Olof Johansson
Committed by
Stephen Hemminger
Jul 28, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[RANDOM]: Fix SMP deadlock in __check_and_rekey().
parent
875ed926
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
drivers/char/random.c
drivers/char/random.c
+4
-2
No files found.
drivers/char/random.c
View file @
395ab5d6
...
...
@@ -251,6 +251,8 @@
#include <linux/fs.h>
#include <linux/workqueue.h>
#include <linux/genhd.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <asm/processor.h>
#include <asm/uaccess.h>
...
...
@@ -2056,7 +2058,7 @@ static unsigned int ip_cnt;
static
struct
keydata
*
__check_and_rekey
(
time_t
time
)
{
struct
keydata
*
keyptr
;
spin_lock
(
&
ip_lock
);
spin_lock
_bh
(
&
ip_lock
);
keyptr
=
&
ip_keydata
[
ip_cnt
&
1
];
if
(
!
keyptr
->
rekey_time
||
(
time
-
keyptr
->
rekey_time
)
>
REKEY_INTERVAL
)
{
keyptr
=
&
ip_keydata
[
1
^
(
ip_cnt
&
1
)];
...
...
@@ -2066,7 +2068,7 @@ static struct keydata *__check_and_rekey(time_t time)
mb
();
ip_cnt
++
;
}
spin_unlock
(
&
ip_lock
);
spin_unlock
_bh
(
&
ip_lock
);
return
keyptr
;
}
...
...
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