diff options
author | Julia Lawall <julia@diku.dk> | 2009-12-13 06:41:12 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-16 06:27:55 -0500 |
commit | 9518f179128b02c221ffdd692249836bb05a94de (patch) | |
tree | 278cc40c41f2432dae3e997f7be1046d1e58820e | |
parent | b4d887cfd735a15d32dbab82334f227a75775b86 (diff) |
V4L/DVB (13685): Correct code taking the size of a pointer
sizeof(print_buf) is just the size of the pointer. Change it to the size
used in the allocation of print_buf earlier in the same function.
A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression *x;
expression f;
type T;
@@
*f(...,(T)x,...)
// </smpl>
Cc: Janne Grunau <j@jannau.net>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/hdpvr/hdpvr-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c index e280eb178fe9..51f393d03a46 100644 --- a/drivers/media/video/hdpvr/hdpvr-core.c +++ b/drivers/media/video/hdpvr/hdpvr-core.c | |||
@@ -145,7 +145,7 @@ static int device_authorization(struct hdpvr_device *dev) | |||
145 | #ifdef HDPVR_DEBUG | 145 | #ifdef HDPVR_DEBUG |
146 | else { | 146 | else { |
147 | hex_dump_to_buffer(dev->usbc_buf, 46, 16, 1, print_buf, | 147 | hex_dump_to_buffer(dev->usbc_buf, 46, 16, 1, print_buf, |
148 | sizeof(print_buf), 0); | 148 | 5*buf_size+1, 0); |
149 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, | 149 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, |
150 | "Status request returned, len %d: %s\n", | 150 | "Status request returned, len %d: %s\n", |
151 | ret, print_buf); | 151 | ret, print_buf); |
@@ -168,13 +168,13 @@ static int device_authorization(struct hdpvr_device *dev) | |||
168 | 168 | ||
169 | response = dev->usbc_buf+38; | 169 | response = dev->usbc_buf+38; |
170 | #ifdef HDPVR_DEBUG | 170 | #ifdef HDPVR_DEBUG |
171 | hex_dump_to_buffer(response, 8, 16, 1, print_buf, sizeof(print_buf), 0); | 171 | hex_dump_to_buffer(response, 8, 16, 1, print_buf, 5*buf_size+1, 0); |
172 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, "challenge: %s\n", | 172 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, "challenge: %s\n", |
173 | print_buf); | 173 | print_buf); |
174 | #endif | 174 | #endif |
175 | challenge(response); | 175 | challenge(response); |
176 | #ifdef HDPVR_DEBUG | 176 | #ifdef HDPVR_DEBUG |
177 | hex_dump_to_buffer(response, 8, 16, 1, print_buf, sizeof(print_buf), 0); | 177 | hex_dump_to_buffer(response, 8, 16, 1, print_buf, 5*buf_size+1, 0); |
178 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, " response: %s\n", | 178 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, " response: %s\n", |
179 | print_buf); | 179 | print_buf); |
180 | #endif | 180 | #endif |