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
681cb8eb
Commit
681cb8eb
authored
Sep 03, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USB: clean up the error path in create_special_files() for usbfs
Thanks to David Brownell for pointing out the problem here.
parent
1cdfd319
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
10 deletions
+32
-10
drivers/usb/core/inode.c
drivers/usb/core/inode.c
+32
-10
No files found.
drivers/usb/core/inode.c
View file @
681cb8eb
...
...
@@ -560,35 +560,57 @@ static void put_mount (struct vfsmount **mount)
static
int
create_special_files
(
void
)
{
struct
dentry
*
parent
;
int
retval
;
int
retval
=
0
;
/* create the devices special file */
retval
=
get_mount
(
&
usbdevice_fs_type
,
&
usbdevfs_mount
);
if
(
retval
)
return
retval
;
if
(
retval
)
{
err
(
"Unable to get usbdevfs mount"
);
goto
exit
;
}
retval
=
get_mount
(
&
usb_fs_type
,
&
usbfs_mount
);
if
(
retval
)
{
put_mount
(
&
usbfs_mount
);
return
retval
;
err
(
"Unable to get usbfs mount"
);
goto
error_clean_usbdevfs_mount
;
}
parent
=
usbfs_mount
->
mnt_sb
->
s_root
;
devices_usbfs_dentry
=
fs_create_file
(
"devices"
,
listmode
|
S_IFREG
,
parent
,
devices_usbfs_dentry
=
fs_create_file
(
"devices"
,
listmode
|
S_IFREG
,
parent
,
NULL
,
&
usbdevfs_devices_fops
,
listuid
,
listgid
);
if
(
devices_usbfs_dentry
==
NULL
)
{
err
(
"Unable to create devices usbfs file"
);
return
-
ENODEV
;
retval
=
-
ENODEV
;
goto
error_clean_mounts
;
}
parent
=
usbdevfs_mount
->
mnt_sb
->
s_root
;
devices_usbdevfs_dentry
=
fs_create_file
(
"devices"
,
listmode
|
S_IFREG
,
parent
,
devices_usbdevfs_dentry
=
fs_create_file
(
"devices"
,
listmode
|
S_IFREG
,
parent
,
NULL
,
&
usbdevfs_devices_fops
,
listuid
,
listgid
);
if
(
devices_usbdevfs_dentry
==
NULL
)
{
err
(
"Unable to create devices usbfs file"
);
return
-
ENODEV
;
retval
=
-
ENODEV
;
goto
error_remove_file
;
}
return
0
;
goto
exit
;
error_remove_file:
fs_remove_file
(
devices_usbfs_dentry
);
devices_usbfs_dentry
=
NULL
;
error_clean_mounts:
put_mount
(
&
usbfs_mount
);
error_clean_usbdevfs_mount:
put_mount
(
&
usbdevfs_mount
);
exit:
return
retval
;
}
static
void
remove_special_files
(
void
)
...
...
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