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
61370ffb
Commit
61370ffb
authored
Aug 22, 2003
by
Daniele Bellucci
Committed by
Greg Kroah-Hartman
Aug 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: PATCH 4/19 Audit usb_register/usb_serial_register under divers/usb/serial
parent
bc516b5b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
drivers/usb/serial/empeg.c
drivers/usb/serial/empeg.c
+19
-5
No files found.
drivers/usb/serial/empeg.c
View file @
61370ffb
...
@@ -558,7 +558,7 @@ static void empeg_set_termios (struct usb_serial_port *port, struct termios *old
...
@@ -558,7 +558,7 @@ static void empeg_set_termios (struct usb_serial_port *port, struct termios *old
static
int
__init
empeg_init
(
void
)
static
int
__init
empeg_init
(
void
)
{
{
struct
urb
*
urb
;
struct
urb
*
urb
;
int
i
;
int
i
,
retval
;
/* create our write urb pool and transfer buffers */
/* create our write urb pool and transfer buffers */
spin_lock_init
(
&
write_urb_pool_lock
);
spin_lock_init
(
&
write_urb_pool_lock
);
...
@@ -570,7 +570,6 @@ static int __init empeg_init (void)
...
@@ -570,7 +570,6 @@ static int __init empeg_init (void)
continue
;
continue
;
}
}
urb
->
transfer_buffer
=
NULL
;
urb
->
transfer_buffer
=
kmalloc
(
URB_TRANSFER_BUFFER_SIZE
,
GFP_KERNEL
);
urb
->
transfer_buffer
=
kmalloc
(
URB_TRANSFER_BUFFER_SIZE
,
GFP_KERNEL
);
if
(
!
urb
->
transfer_buffer
)
{
if
(
!
urb
->
transfer_buffer
)
{
err
(
"%s - out of memory for urb buffers."
,
err
(
"%s - out of memory for urb buffers."
,
...
@@ -579,12 +578,27 @@ static int __init empeg_init (void)
...
@@ -579,12 +578,27 @@ static int __init empeg_init (void)
}
}
}
}
usb_serial_register
(
&
empeg_device
);
retval
=
usb_serial_register
(
&
empeg_device
);
usb_register
(
&
empeg_driver
);
if
(
retval
)
goto
failed_usb_serial_register
;
retval
=
usb_register
(
&
empeg_driver
);
if
(
retval
)
goto
failed_usb_register
;
info
(
DRIVER_VERSION
":"
DRIVER_DESC
);
info
(
DRIVER_VERSION
":"
DRIVER_DESC
);
return
0
;
return
0
;
failed_usb_register:
usb_serial_deregister
(
&
empeg_device
);
failed_usb_serial_register:
for
(
i
=
0
;
i
<
NUM_URBS
;
++
i
)
{
if
(
write_urb_pool
[
i
])
{
if
(
write_urb_pool
[
i
]
->
transfer_buffer
)
kfree
(
write_urb_pool
[
i
]
->
transfer_buffer
);
usb_free_urb
(
write_urb_pool
[
i
]);
}
}
return
retval
;
}
}
...
@@ -593,7 +607,7 @@ static void __exit empeg_exit (void)
...
@@ -593,7 +607,7 @@ static void __exit empeg_exit (void)
int
i
;
int
i
;
unsigned
long
flags
;
unsigned
long
flags
;
usb_
register
(
&
empeg_driver
);
usb_
deregister
(
&
empeg_driver
);
usb_serial_deregister
(
&
empeg_device
);
usb_serial_deregister
(
&
empeg_device
);
spin_lock_irqsave
(
&
write_urb_pool_lock
,
flags
);
spin_lock_irqsave
(
&
write_urb_pool_lock
,
flags
);
...
...
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