lguest_user.c: fix memory leak
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>
This commit is contained in:
parent
62ec56524f
commit
43054412db
|
@ -184,7 +184,7 @@ static int initialize(struct file *file, const unsigned long __user *input)
|
||||||
free_regs:
|
free_regs:
|
||||||
free_page(lg->regs_page);
|
free_page(lg->regs_page);
|
||||||
release_guest:
|
release_guest:
|
||||||
memset(lg, 0, sizeof(*lg));
|
kfree(lg);
|
||||||
unlock:
|
unlock:
|
||||||
mutex_unlock(&lguest_lock);
|
mutex_unlock(&lguest_lock);
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Reference in New Issue