From: Adrian Bunk Date: Thu, 15 Nov 2007 00:59:00 +0000 (-0800) Subject: lguest_user.c: fix memory leak X-Git-Tag: v2.6.24-rc3~112 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43054412db5e5b3eda1eff6c2245ff4257560340;p=linux-2.6 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 9d716fa42c..3b92a61ba8 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;