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
03360765
Commit
03360765
authored
Dec 08, 2002
by
Oliver Neukum
Committed by
Greg Kroah-Hartman
Dec 08, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB usbfs: fix race between disconnect and usbdev_open
parent
ababa0cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
drivers/usb/core/devio.c
drivers/usb/core/devio.c
+8
-4
No files found.
drivers/usb/core/devio.c
View file @
03360765
...
...
@@ -484,14 +484,17 @@ static int usbdev_open(struct inode *inode, struct file *file)
* and the hub thread have the kernel lock
* (still acquire the kernel lock for safety)
*/
ret
=
-
ENOMEM
;
if
(
!
(
ps
=
kmalloc
(
sizeof
(
struct
dev_state
),
GFP_KERNEL
)))
goto
out_nolock
;
lock_kernel
();
ret
=
-
ENOENT
;
dev
=
inode
->
u
.
generic_ip
;
if
(
!
dev
)
goto
out
;
ret
=
-
ENOMEM
;
if
(
!
(
ps
=
kmalloc
(
sizeof
(
struct
dev_state
),
GFP_KERNEL
)))
if
(
!
dev
)
{
kfree
(
ps
);
goto
out
;
}
ret
=
0
;
ps
->
dev
=
dev
;
ps
->
file
=
file
;
...
...
@@ -509,6 +512,7 @@ static int usbdev_open(struct inode *inode, struct file *file)
file
->
private_data
=
ps
;
out:
unlock_kernel
();
out_nolock:
return
ret
;
}
...
...
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