From: Adrian Bunk Date: Thu, 15 Nov 2007 00:59:00 +0000 (-0800) Subject: lguest_user.c: fix memory leak X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=43054412db5e5b3eda1eff6c2245ff4257560340;p=openwrt%2Fstaging%2Fblogic.git lguest_user.c: fix memory leak This patch fixes a memory leak spotted by the Coverity checker. Signed-off-by: Adrian Bunk Cc: Rusty Russell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c index 9d716fa42cad..3b92a61ba8d2 100644 --- a/drivers/lguest/lguest_user.c +++ b/drivers/lguest/lguest_user.c @@ -184,7 +184,7 @@ static int initialize(struct file *file, const unsigned long __user *input) free_regs: free_page(lg->regs_page); release_guest: - memset(lg, 0, sizeof(*lg)); + kfree(lg); unlock: mutex_unlock(&lguest_lock); return err;