diff options
Diffstat (limited to 'drivers/firewire')
-rw-r--r-- | drivers/firewire/core-cdev.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index ced186d7e9a9..0516acd55ab9 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c | |||
@@ -698,6 +698,7 @@ static int ioctl_send_response(struct client *client, void *buffer) | |||
698 | struct fw_cdev_send_response *request = buffer; | 698 | struct fw_cdev_send_response *request = buffer; |
699 | struct client_resource *resource; | 699 | struct client_resource *resource; |
700 | struct inbound_transaction_resource *r; | 700 | struct inbound_transaction_resource *r; |
701 | int ret = 0; | ||
701 | 702 | ||
702 | if (release_client_resource(client, request->handle, | 703 | if (release_client_resource(client, request->handle, |
703 | release_request, &resource) < 0) | 704 | release_request, &resource) < 0) |
@@ -707,13 +708,17 @@ static int ioctl_send_response(struct client *client, void *buffer) | |||
707 | resource); | 708 | resource); |
708 | if (request->length < r->length) | 709 | if (request->length < r->length) |
709 | r->length = request->length; | 710 | r->length = request->length; |
710 | if (copy_from_user(r->data, u64_to_uptr(request->data), r->length)) | 711 | |
711 | return -EFAULT; | 712 | if (copy_from_user(r->data, u64_to_uptr(request->data), r->length)) { |
713 | ret = -EFAULT; | ||
714 | goto out; | ||
715 | } | ||
712 | 716 | ||
713 | fw_send_response(client->device->card, r->request, request->rcode); | 717 | fw_send_response(client->device->card, r->request, request->rcode); |
718 | out: | ||
714 | kfree(r); | 719 | kfree(r); |
715 | 720 | ||
716 | return 0; | 721 | return ret; |
717 | } | 722 | } |
718 | 723 | ||
719 | static int ioctl_initiate_bus_reset(struct client *client, void *buffer) | 724 | static int ioctl_initiate_bus_reset(struct client *client, void *buffer) |