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
Kirill Smelkov
linux
Commits
04af2203
Commit
04af2203
authored
Feb 01, 2004
by
Oliver Neukum
Committed by
Greg Kroah-Hartman
Feb 01, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: fix DMA to stack in tt-usb
this driver does DMA to the stack via usb_bulk_msg().
parent
cd67fa07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
drivers/media/dvb/ttusb-dec/ttusb_dec.c
drivers/media/dvb/ttusb-dec/ttusb_dec.c
+21
-4
No files found.
drivers/media/dvb/ttusb-dec/ttusb_dec.c
View file @
04af2203
...
...
@@ -204,12 +204,23 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
int
*
result_length
,
u8
cmd_result
[])
{
int
result
,
actual_len
,
i
;
u8
b
[
COMMAND_PACKET_SIZE
+
4
];
u8
c
[
COMMAND_PACKET_SIZE
+
4
];
u8
*
b
;
u8
*
c
;
b
=
kmalloc
(
COMMAND_PACKET_SIZE
+
4
,
GFP_KERNEL
);
if
(
!
b
)
return
-
ENOMEM
;
c
=
kmalloc
(
COMMAND_PACKET_SIZE
+
4
,
GFP_KERNEL
);
if
(
!
c
)
{
kfree
(
b
);
return
-
ENOMEM
;
}
dprintk
(
"%s
\n
"
,
__FUNCTION__
);
if
((
result
=
down_interruptible
(
&
dec
->
usb_sem
)))
{
kfree
(
b
);
kfree
(
c
);
printk
(
"%s: Failed to down usb semaphore.
\n
"
,
__FUNCTION__
);
return
result
;
}
...
...
@@ -230,22 +241,26 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
}
result
=
usb_bulk_msg
(
dec
->
udev
,
dec
->
command_pipe
,
b
,
sizeof
(
b
)
,
&
actual_len
,
HZ
);
COMMAND_PACKET_SIZE
+
4
,
&
actual_len
,
HZ
);
if
(
result
)
{
printk
(
"%s: command bulk message failed: error %d
\n
"
,
__FUNCTION__
,
result
);
up
(
&
dec
->
usb_sem
);
kfree
(
b
);
kfree
(
c
);
return
result
;
}
result
=
usb_bulk_msg
(
dec
->
udev
,
dec
->
result_pipe
,
c
,
sizeof
(
c
)
,
&
actual_len
,
HZ
);
COMMAND_PACKET_SIZE
+
4
,
&
actual_len
,
HZ
);
if
(
result
)
{
printk
(
"%s: result bulk message failed: error %d
\n
"
,
__FUNCTION__
,
result
);
up
(
&
dec
->
usb_sem
);
kfree
(
b
);
kfree
(
c
);
return
result
;
}
else
{
if
(
debug
)
{
...
...
@@ -262,6 +277,8 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
up
(
&
dec
->
usb_sem
);
kfree
(
b
);
kfree
(
c
);
return
0
;
}
}
...
...
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