From: Stefan Richter Date: Sat, 26 Dec 2009 00:34:29 +0000 (+0100) Subject: firewire: cdev: fix another memory leak in an error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cf0e575dcc4cab9fd955e9bec49df7e8ee30a7cf;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git firewire: cdev: fix another memory leak in an error path 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 --- diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 2cb22d160f6e..e6d63849e78e 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -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,