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
abcd7d5d
Commit
abcd7d5d
authored
Aug 14, 2003
by
Daniele Bellucci
Committed by
Greg Kroah-Hartman
Aug 14, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: usbvideo cleanup on error
parent
81213932
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
drivers/usb/media/usbvideo.c
drivers/usb/media/usbvideo.c
+15
-4
No files found.
drivers/usb/media/usbvideo.c
View file @
abcd7d5d
...
@@ -777,7 +777,7 @@ int usbvideo_register(
...
@@ -777,7 +777,7 @@ int usbvideo_register(
const
struct
usb_device_id
*
id_table
)
const
struct
usb_device_id
*
id_table
)
{
{
struct
usbvideo
*
cams
;
struct
usbvideo
*
cams
;
int
i
,
base_size
;
int
i
,
base_size
,
result
;
/* Check parameters for sanity */
/* Check parameters for sanity */
if
((
num_cams
<=
0
)
||
(
pCams
==
NULL
)
||
(
cbTbl
==
NULL
))
{
if
((
num_cams
<=
0
)
||
(
pCams
==
NULL
)
||
(
cbTbl
==
NULL
))
{
...
@@ -846,9 +846,13 @@ int usbvideo_register(
...
@@ -846,9 +846,13 @@ int usbvideo_register(
up
->
user_size
=
num_cams
*
num_extra
;
up
->
user_size
=
num_cams
*
num_extra
;
up
->
user_data
=
(
char
*
)
kmalloc
(
up
->
user_size
,
GFP_KERNEL
);
up
->
user_data
=
(
char
*
)
kmalloc
(
up
->
user_size
,
GFP_KERNEL
);
if
(
up
->
user_data
==
NULL
)
{
if
(
up
->
user_data
==
NULL
)
{
up
->
user_size
=
0
;
err
(
"%s: Failed to allocate user_data (%d. bytes)"
,
err
(
"%s: Failed to allocate user_data (%d. bytes)"
,
__FUNCTION__
,
up
->
user_size
);
__FUNCTION__
,
up
->
user_size
);
while
(
i
)
{
up
=
&
cams
->
cam
[
--
i
];
kfree
(
up
->
user_data
);
}
kfree
(
cams
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
dbg
(
"%s: Allocated cams[%d].user_data=$%p (%d. bytes)"
,
dbg
(
"%s: Allocated cams[%d].user_data=$%p (%d. bytes)"
,
...
@@ -878,9 +882,16 @@ int usbvideo_register(
...
@@ -878,9 +882,16 @@ int usbvideo_register(
* If the handle is not yet updated then the probe() will fail.
* If the handle is not yet updated then the probe() will fail.
*/
*/
*
pCams
=
cams
;
*
pCams
=
cams
;
usb_register
(
&
cams
->
usbdrv
);
result
=
usb_register
(
&
cams
->
usbdrv
);
if
(
result
)
{
for
(
i
=
0
;
i
<
num_cams
;
i
++
)
{
struct
uvd
*
up
=
&
cams
->
cam
[
i
];
kfree
(
up
->
user_data
);
}
kfree
(
cams
);
}
return
0
;
return
result
;
}
}
EXPORT_SYMBOL
(
usbvideo_register
);
EXPORT_SYMBOL
(
usbvideo_register
);
...
...
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