Skip to content

Commit

Permalink
lguest_user.c: fix memory leak
Browse files Browse the repository at this point in the history
This patch fixes a memory leak spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Nov 15, 2007
1 parent 62ec565 commit 4305441
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/lguest/lguest_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4305441

Please sign in to comment.