Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57058
b: refs/heads/master
c: 976da96
h: refs/heads/master
v: v3
  • Loading branch information
Petr Vandrovec authored and Stefan Richter committed May 27, 2007
1 parent ae3331e commit 0da40c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef50a6c59dc66f22eba67704e291d709f21e0456
refs/heads/master: 976da96a5d4fe84bd292b950e566325dc3e5904e
8 changes: 5 additions & 3 deletions trunk/drivers/ieee1394/raw1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
struct hpsb_packet *packet;
int header_length = req->req.misc & 0xffff;
int expect_response = req->req.misc >> 16;
size_t data_size;

if (header_length > req->req.length || header_length < 12 ||
header_length > FIELD_SIZEOF(struct hpsb_packet, header)) {
Expand All @@ -945,7 +946,8 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
return sizeof(struct raw1394_request);
}

packet = hpsb_alloc_packet(req->req.length - header_length);
data_size = req->req.length - header_length;
packet = hpsb_alloc_packet(data_size);
req->packet = packet;
if (!packet)
return -ENOMEM;
Expand All @@ -960,7 +962,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)

if (copy_from_user
(packet->data, int2ptr(req->req.sendb) + header_length,
packet->data_size)) {
data_size)) {
req->req.error = RAW1394_ERROR_MEMFAULT;
req->req.length = 0;
queue_complete_req(req);
Expand All @@ -974,7 +976,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
packet->host = fi->host;
packet->expect_response = expect_response;
packet->header_size = header_length;
packet->data_size = req->req.length - header_length;
packet->data_size = data_size;

req->req.length = 0;
hpsb_set_packet_complete_task(packet,
Expand Down

0 comments on commit 0da40c0

Please sign in to comment.