aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/core-cdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/core-cdev.c')
-rw-r--r--drivers/firewire/core-cdev.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index 231e6ee5ba43..e6d63849e78e 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -601,8 +601,9 @@ static void release_request(struct client *client,
601 struct inbound_transaction_resource *r = container_of(resource, 601 struct inbound_transaction_resource *r = container_of(resource,
602 struct inbound_transaction_resource, resource); 602 struct inbound_transaction_resource, resource);
603 603
604 fw_send_response(client->device->card, r->request, 604 if (r->request)
605 RCODE_CONFLICT_ERROR); 605 fw_send_response(client->device->card, r->request,
606 RCODE_CONFLICT_ERROR);
606 kfree(r); 607 kfree(r);
607} 608}
608 609
@@ -645,7 +646,8 @@ static void handle_request(struct fw_card *card, struct fw_request *request,
645 failed: 646 failed:
646 kfree(r); 647 kfree(r);
647 kfree(e); 648 kfree(e);
648 fw_send_response(card, request, RCODE_CONFLICT_ERROR); 649 if (request)
650 fw_send_response(card, request, RCODE_CONFLICT_ERROR);
649} 651}
650 652
651static void release_address_handler(struct client *client, 653static void release_address_handler(struct client *client,
@@ -715,15 +717,18 @@ static int ioctl_send_response(struct client *client, void *buffer)
715 717
716 r = container_of(resource, struct inbound_transaction_resource, 718 r = container_of(resource, struct inbound_transaction_resource,
717 resource); 719 resource);
718 if (request->length < r->length) 720 if (r->request) {
719 r->length = request->length; 721 if (request->length < r->length)
720 722 r->length = request->length;
721 if (copy_from_user(r->data, u64_to_uptr(request->data), r->length)) { 723 if (copy_from_user(r->data, u64_to_uptr(request->data),
722 ret = -EFAULT; 724 r->length)) {
723 goto out; 725 ret = -EFAULT;
726 kfree(r->request);
727 goto out;
728 }
729 fw_send_response(client->device->card, r->request,
730 request->rcode);
724 } 731 }
725
726 fw_send_response(client->device->card, r->request, request->rcode);
727 out: 732 out:
728 kfree(r); 733 kfree(r);
729 734