Skip to content

Commit

Permalink
firewire: cdev: fix another memory leak in an error path
Browse files Browse the repository at this point in the history
If copy_from_user in an FW_CDEV_IOC_SEND_RESPONSE ioctl failed, the
fw_request pointed to by the inbound_transaction_resource is no
longer referenced and needs to be freed.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
  • Loading branch information
Stefan Richter committed Dec 29, 2009
1 parent db5d247 commit cf0e575
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/firewire/core-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ static int ioctl_send_response(struct client *client, void *buffer)
if (copy_from_user(r->data, u64_to_uptr(request->data),
r->length)) {
ret = -EFAULT;
kfree(r->request);
goto out;
}
fw_send_response(client->device->card, r->request,
Expand Down

0 comments on commit cf0e575

Please sign in to comment.