Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757680AbYF2AH7 (ORCPT ); Sat, 28 Jun 2008 20:07:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754841AbYF2AHt (ORCPT ); Sat, 28 Jun 2008 20:07:49 -0400 Received: from extu-mxob-1.symantec.com ([216.10.194.28]:33924 "EHLO extu-mxob-1.symantec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754823AbYF2AHK (ORCPT ); Sat, 28 Jun 2008 20:07:10 -0400 Date: Sun, 29 Jun 2008 01:07:15 +0100 (BST) From: Hugh Dickins X-X-Sender: hugh@blonde.site To: Erez Zadok cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH] unionfs: fix memory leak In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1145 Lines: 28 Unionfs has slowly been leaking memory: although many places do explicitly free the dentry's lower_paths array (and I've not changed those, in case the ordering is important), not all do - and adding a WARN_ON didn't seem to finger any particular culprit. So free_dentry_private_data needs to kfree lower_paths (other freeers are good about setting it to NULL). Signed-off-by: Hugh Dickins --- Should follow mmotm's git-unionfs-fixup.patch fs/unionfs/lookup.c | 1 + 1 file changed, 1 insertion(+) --- mmotm/fs/unionfs/lookup.c 2008-06-27 13:39:18.000000000 +0100 +++ linux/fs/unionfs/lookup.c 2008-06-27 14:08:00.000000000 +0100 @@ -498,6 +498,7 @@ void free_dentry_private_data(struct den { if (!dentry || !dentry->d_fsdata) return; + kfree(UNIONFS_D(dentry)->lower_paths); kmem_cache_free(unionfs_dentry_cachep, dentry->d_fsdata); dentry->d_fsdata = NULL; } -- 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/