diff options
-rw-r--r-- | drivers/firewire/core-cdev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 8cbc2b8a8272..8f8c8eeaf046 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c | |||
@@ -627,6 +627,8 @@ static void release_request(struct client *client, | |||
627 | kfree(r->data); | 627 | kfree(r->data); |
628 | else | 628 | else |
629 | fw_send_response(r->card, r->request, RCODE_CONFLICT_ERROR); | 629 | fw_send_response(r->card, r->request, RCODE_CONFLICT_ERROR); |
630 | |||
631 | fw_card_put(r->card); | ||
630 | kfree(r); | 632 | kfree(r); |
631 | } | 633 | } |
632 | 634 | ||
@@ -641,6 +643,9 @@ static void handle_request(struct fw_card *card, struct fw_request *request, | |||
641 | void *fcp_frame = NULL; | 643 | void *fcp_frame = NULL; |
642 | int ret; | 644 | int ret; |
643 | 645 | ||
646 | /* card may be different from handler->client->device->card */ | ||
647 | fw_card_get(card); | ||
648 | |||
644 | r = kmalloc(sizeof(*r), GFP_ATOMIC); | 649 | r = kmalloc(sizeof(*r), GFP_ATOMIC); |
645 | e = kmalloc(sizeof(*e), GFP_ATOMIC); | 650 | e = kmalloc(sizeof(*e), GFP_ATOMIC); |
646 | if (r == NULL || e == NULL) | 651 | if (r == NULL || e == NULL) |
@@ -686,6 +691,8 @@ static void handle_request(struct fw_card *card, struct fw_request *request, | |||
686 | 691 | ||
687 | if (!is_fcp_request(request)) | 692 | if (!is_fcp_request(request)) |
688 | fw_send_response(card, request, RCODE_CONFLICT_ERROR); | 693 | fw_send_response(card, request, RCODE_CONFLICT_ERROR); |
694 | |||
695 | fw_card_put(card); | ||
689 | } | 696 | } |
690 | 697 | ||
691 | static void release_address_handler(struct client *client, | 698 | static void release_address_handler(struct client *client, |
@@ -768,6 +775,7 @@ static int ioctl_send_response(struct client *client, union ioctl_arg *arg) | |||
768 | } | 775 | } |
769 | fw_send_response(r->card, r->request, a->rcode); | 776 | fw_send_response(r->card, r->request, a->rcode); |
770 | out: | 777 | out: |
778 | fw_card_put(r->card); | ||
771 | kfree(r); | 779 | kfree(r); |
772 | 780 | ||
773 | return ret; | 781 | return ret; |