Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
f9c8154f
Commit
f9c8154f
authored
May 20, 2008
by
Arnd Bergmann
Committed by
Jonathan Corbet
Jul 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mousedev: BKL pushdown
Signed-off-by:
Arnd Bergmann
<
arnd@arndb.de
>
parent
dca67e9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
drivers/input/mousedev.c
drivers/input/mousedev.c
+10
-2
No files found.
drivers/input/mousedev.c
View file @
f9c8154f
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#define MOUSEDEV_MIX 31
#define MOUSEDEV_MIX 31
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/poll.h>
#include <linux/poll.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -545,16 +546,21 @@ static int mousedev_open(struct inode *inode, struct file *file)
...
@@ -545,16 +546,21 @@ static int mousedev_open(struct inode *inode, struct file *file)
if
(
i
>=
MOUSEDEV_MINORS
)
if
(
i
>=
MOUSEDEV_MINORS
)
return
-
ENODEV
;
return
-
ENODEV
;
lock_kernel
();
error
=
mutex_lock_interruptible
(
&
mousedev_table_mutex
);
error
=
mutex_lock_interruptible
(
&
mousedev_table_mutex
);
if
(
error
)
if
(
error
)
{
unlock_kernel
();
return
error
;
return
error
;
}
mousedev
=
mousedev_table
[
i
];
mousedev
=
mousedev_table
[
i
];
if
(
mousedev
)
if
(
mousedev
)
get_device
(
&
mousedev
->
dev
);
get_device
(
&
mousedev
->
dev
);
mutex_unlock
(
&
mousedev_table_mutex
);
mutex_unlock
(
&
mousedev_table_mutex
);
if
(
!
mousedev
)
if
(
!
mousedev
)
{
unlock_kernel
();
return
-
ENODEV
;
return
-
ENODEV
;
}
client
=
kzalloc
(
sizeof
(
struct
mousedev_client
),
GFP_KERNEL
);
client
=
kzalloc
(
sizeof
(
struct
mousedev_client
),
GFP_KERNEL
);
if
(
!
client
)
{
if
(
!
client
)
{
...
@@ -573,6 +579,7 @@ static int mousedev_open(struct inode *inode, struct file *file)
...
@@ -573,6 +579,7 @@ static int mousedev_open(struct inode *inode, struct file *file)
goto
err_free_client
;
goto
err_free_client
;
file
->
private_data
=
client
;
file
->
private_data
=
client
;
unlock_kernel
();
return
0
;
return
0
;
err_free_client:
err_free_client:
...
@@ -580,6 +587,7 @@ static int mousedev_open(struct inode *inode, struct file *file)
...
@@ -580,6 +587,7 @@ static int mousedev_open(struct inode *inode, struct file *file)
kfree
(
client
);
kfree
(
client
);
err_put_mousedev:
err_put_mousedev:
put_device
(
&
mousedev
->
dev
);
put_device
(
&
mousedev
->
dev
);
unlock_kernel
();
return
error
;
return
error
;
}
}
...
...
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