diff options
author | Tilman Schmidt <tilman@imap.cc> | 2010-02-22 08:09:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-26 04:24:23 -0500 |
commit | 63e055d1c6e3a5f6d370cc841d621d5fa4d5d834 (patch) | |
tree | 80f645c85bbc012d3b1b45ab66ee7dd8938de49b /drivers/isdn/gigaset/gigaset.h | |
parent | 2ac2ed5f2dfc97ae9ed9f446ad6e064fa821ef6d (diff) |
bas_gigaset: collapse CR/LF at end of AT response
Copy the mechanism from ser_/usb_gigaset to avoid producing
spurious empty responses for CR/LF sequences from the device.
Add a comment in all drivers documenting that behaviour.
Correct an off by one error that might result in a one byte
buffer overflow when receiving an unexpectedly long reply.
Impact: minor bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset/gigaset.h')
-rw-r--r-- | drivers/isdn/gigaset/gigaset.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h index e963a6c2e86d..c9ccf7de2275 100644 --- a/drivers/isdn/gigaset/gigaset.h +++ b/drivers/isdn/gigaset/gigaset.h | |||
@@ -38,7 +38,7 @@ | |||
38 | #define GIG_COMPAT {0, 4, 0, 0} | 38 | #define GIG_COMPAT {0, 4, 0, 0} |
39 | 39 | ||
40 | #define MAX_REC_PARAMS 10 /* Max. number of params in response string */ | 40 | #define MAX_REC_PARAMS 10 /* Max. number of params in response string */ |
41 | #define MAX_RESP_SIZE 512 /* Max. size of a response string */ | 41 | #define MAX_RESP_SIZE 511 /* Max. size of a response string */ |
42 | 42 | ||
43 | #define MAX_EVENTS 64 /* size of event queue */ | 43 | #define MAX_EVENTS 64 /* size of event queue */ |
44 | 44 | ||
@@ -498,7 +498,7 @@ struct cardstate { | |||
498 | spinlock_t ev_lock; | 498 | spinlock_t ev_lock; |
499 | 499 | ||
500 | /* current modem response */ | 500 | /* current modem response */ |
501 | unsigned char respdata[MAX_RESP_SIZE]; | 501 | unsigned char respdata[MAX_RESP_SIZE+1]; |
502 | unsigned cbytes; | 502 | unsigned cbytes; |
503 | 503 | ||
504 | /* private data of hardware drivers */ | 504 | /* private data of hardware drivers */ |