Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135990
b: refs/heads/master
c: 1f3125a
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Richter committed Mar 24, 2009
1 parent 202bff6 commit 0ebc20c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 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: bf8e3355ec8f4e472f9841e94203cd759b45226e
refs/heads/master: 1f3125af8ed7410cc0ebcc0acd59bbfc1ae0057a
27 changes: 25 additions & 2 deletions trunk/drivers/firewire/fw-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ static int ioctl_send_request(struct client *client, void *buffer)
struct fw_device *device = client->device;
struct fw_cdev_send_request *request = buffer;
struct response *response;
int ret;

/* What is the biggest size we'll accept, really? */
if (request->length > 4096)
Expand All @@ -414,8 +415,26 @@ static int ioctl_send_request(struct client *client, void *buffer)
if (request->data &&
copy_from_user(response->response.data,
u64_to_uptr(request->data), request->length)) {
kfree(response);
return -EFAULT;
ret = -EFAULT;
goto err;
}

switch (request->tcode) {
case TCODE_WRITE_QUADLET_REQUEST:
case TCODE_WRITE_BLOCK_REQUEST:
case TCODE_READ_QUADLET_REQUEST:
case TCODE_READ_BLOCK_REQUEST:
case TCODE_LOCK_MASK_SWAP:
case TCODE_LOCK_COMPARE_SWAP:
case TCODE_LOCK_FETCH_ADD:
case TCODE_LOCK_LITTLE_ADD:
case TCODE_LOCK_BOUNDED_ADD:
case TCODE_LOCK_WRAP_ADD:
case TCODE_LOCK_VENDOR_DEPENDENT:
break;
default:
ret = -EINVAL;
goto err;
}

response->resource.release = release_transaction;
Expand All @@ -434,6 +453,10 @@ static int ioctl_send_request(struct client *client, void *buffer)
return sizeof(request) + request->length;
else
return sizeof(request);
err:
kfree(response);

return ret;
}

struct address_handler {
Expand Down

0 comments on commit 0ebc20c

Please sign in to comment.