diff options
author | JiSheng Zhang <jszhang3@mail.ustc.edu.cn> | 2008-07-19 03:35:41 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2008-07-20 09:25:03 -0400 |
commit | f9543d0ab6392a9a5bff0034622688dc10d9d225 (patch) | |
tree | 44587aa693b3fe444cab25aaad2c6c5e95f5f4ee | |
parent | 1e8afea124added6409d5209f90d9949f5a13b32 (diff) |
firewire: queue the right number of data
There will be 4 padding bytes in struct fw_cdev_event_response on some platforms
The member:__u32 data will point to these padding bytes. While queue the
response and data in complete_transaction in fw-cdev.c, it will queue like this:
|response(excluding padding bytes)|4 padding bytes|4 padding bytes|data.
It queue 4 extra bytes. That is to say it use "&response + sizeof(response)"
while other place of kernel and userspace library use "&response + offsetof
(typeof(response), data)". So it will lost the last 4 bytes of data. This patch
can fix it while not changing the struct definition.
Signed-off-by: JiSheng Zhang <jszhang3@mail.ustc.edu.cn>
This fixes responses to outbound block read requests on 64bit architectures.
Tested on i686, x86-64, and x86-64 with i686 userland, using firecontrol and
gscanbus.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | drivers/firewire/fw-cdev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c index c639915fc3c..bc81d6fcd2f 100644 --- a/drivers/firewire/fw-cdev.c +++ b/drivers/firewire/fw-cdev.c | |||
@@ -382,9 +382,9 @@ complete_transaction(struct fw_card *card, int rcode, | |||
382 | 382 | ||
383 | response->response.type = FW_CDEV_EVENT_RESPONSE; | 383 | response->response.type = FW_CDEV_EVENT_RESPONSE; |
384 | response->response.rcode = rcode; | 384 | response->response.rcode = rcode; |
385 | queue_event(client, &response->event, | 385 | queue_event(client, &response->event, &response->response, |
386 | &response->response, sizeof(response->response), | 386 | sizeof(response->response) + response->response.length, |
387 | response->response.data, response->response.length); | 387 | NULL, 0); |
388 | } | 388 | } |
389 | 389 | ||
390 | static int ioctl_send_request(struct client *client, void *buffer) | 390 | static int ioctl_send_request(struct client *client, void *buffer) |