Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757414AbZLZAeg (ORCPT ); Fri, 25 Dec 2009 19:34:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753718AbZLZAef (ORCPT ); Fri, 25 Dec 2009 19:34:35 -0500 Received: from einhorn.in-berlin.de ([192.109.42.8]:53601 "EHLO einhorn.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbZLZAee (ORCPT ); Fri, 25 Dec 2009 19:34:34 -0500 X-Envelope-From: stefanr@s5r6.in-berlin.de Date: Sat, 26 Dec 2009 01:34:29 +0100 (CET) From: Stefan Richter Subject: [PATCH 2/5] firewire: cdev: fix another memory leak in an error path To: linux-kernel@vger.kernel.org cc: linux1394-devel@lists.sourceforge.net, Clemens Ladisch In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1104 Lines: 32 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 --- drivers/firewire/core-cdev.c | 1 + 1 file changed, 1 insertion(+) Index: linux-2.6.33-rc2/drivers/firewire/core-cdev.c =================================================================== --- linux-2.6.33-rc2.orig/drivers/firewire/core-cdev.c +++ linux-2.6.33-rc2/drivers/firewire/core-cdev.c @@ -723,6 +723,7 @@ static int ioctl_send_response(struct cl 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, -- Stefan Richter -=====-==--= ==-- ==-=- http://arcgraph.de/sr/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/