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
5d3e55ea
Commit
5d3e55ea
authored
Sep 15, 2003
by
Duncan Sands
Committed by
Greg Kroah-Hartman
Sep 15, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB speedtouch: neater sanity check
Biscuit for Greg.
parent
6b12b37e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
drivers/usb/misc/speedtch.c
drivers/usb/misc/speedtch.c
+10
-7
No files found.
drivers/usb/misc/speedtch.c
View file @
5d3e55ea
...
...
@@ -84,6 +84,11 @@
#include <linux/usb.h>
#ifdef DEBUG
#define DEBUG_ON(x) BUG_ON(x)
#else
#define DEBUG_ON(x) do { if (x); } while (0)
#endif
#ifdef VERBOSE_DEBUG
static
int
udsl_print_packet
(
const
unsigned
char
*
data
,
int
len
);
...
...
@@ -351,7 +356,7 @@ static void udsl_extract_cells (struct udsl_instance_data *instance, unsigned ch
dbg
(
"udsl_extract_cells: buffer overrun (max_pdu: %u, skb->len %u, vcc: 0x%p)"
,
vcc_data
->
max_pdu
,
skb
->
len
,
vcc
);
/* discard cells already received */
skb_trim
(
skb
,
0
);
BUG_ON
(
vcc_data
->
max_pdu
<
ATM_CELL_PAYLOAD
);
DE
BUG_ON
(
vcc_data
->
max_pdu
<
ATM_CELL_PAYLOAD
);
}
memcpy
(
skb
->
tail
,
source
+
ATM_CELL_HEADER
,
ATM_CELL_PAYLOAD
);
...
...
@@ -498,7 +503,7 @@ static unsigned int udsl_write_cells (unsigned int howmany, struct sk_buff *skb,
memset
(
target
,
0
,
ATM_CELL_PAYLOAD
-
ATM_AAL5_TRAILER
);
target
+=
ATM_CELL_PAYLOAD
-
ATM_AAL5_TRAILER
;
BUG_ON
(
--
ctrl
->
num_cells
);
DE
BUG_ON
(
--
ctrl
->
num_cells
);
}
memcpy
(
target
,
ctrl
->
aal5_trailer
,
ATM_AAL5_TRAILER
);
...
...
@@ -535,7 +540,7 @@ static void udsl_complete_receive (struct urb *urb, struct pt_regs *regs)
vdbg
(
"udsl_complete_receive: urb 0x%p, status %d, actual_length %d, filled_cells %u, rcv 0x%p, buf 0x%p"
,
urb
,
urb
->
status
,
urb
->
actual_length
,
buf
->
filled_cells
,
rcv
,
buf
);
BUG_ON
(
buf
->
filled_cells
>
rcv_buf_size
);
DE
BUG_ON
(
buf
->
filled_cells
>
rcv_buf_size
);
/* may not be in_interrupt() */
spin_lock_irqsave
(
&
instance
->
receive_lock
,
flags
);
...
...
@@ -1216,8 +1221,7 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
count
=
0
;
spin_lock_irq
(
&
instance
->
receive_lock
);
list_for_each
(
pos
,
&
instance
->
spare_receivers
)
if
(
++
count
>
num_rcv_urbs
)
panic
(
__FILE__
": memory corruption detected at line %d!
\n
"
,
__LINE__
);
DEBUG_ON
(
++
count
>
num_rcv_urbs
);
spin_unlock_irq
(
&
instance
->
receive_lock
);
dbg
(
"udsl_usb_disconnect: found %u spare receivers"
,
count
);
...
...
@@ -1253,8 +1257,7 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
count
=
0
;
spin_lock_irq
(
&
instance
->
send_lock
);
list_for_each
(
pos
,
&
instance
->
spare_senders
)
if
(
++
count
>
num_snd_urbs
)
panic
(
__FILE__
": memory corruption detected at line %d!
\n
"
,
__LINE__
);
DEBUG_ON
(
++
count
>
num_snd_urbs
);
spin_unlock_irq
(
&
instance
->
send_lock
);
dbg
(
"udsl_usb_disconnect: found %u spare senders"
,
count
);
...
...
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