diff options
Diffstat (limited to 'drivers/lguest')
-rw-r--r-- | drivers/lguest/lguest_user.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c index 34bc017b8b3..b8ee103eed5 100644 --- a/drivers/lguest/lguest_user.c +++ b/drivers/lguest/lguest_user.c | |||
@@ -307,9 +307,8 @@ static int close(struct inode *inode, struct file *file) | |||
307 | * kmalloc()ed string, either of which is ok to hand to kfree(). */ | 307 | * kmalloc()ed string, either of which is ok to hand to kfree(). */ |
308 | if (!IS_ERR(lg->dead)) | 308 | if (!IS_ERR(lg->dead)) |
309 | kfree(lg->dead); | 309 | kfree(lg->dead); |
310 | /* We clear the entire structure, which also marks it as free for the | 310 | /* Free the memory allocated to the lguest_struct */ |
311 | * next user. */ | 311 | kfree(lg); |
312 | memset(lg, 0, sizeof(*lg)); | ||
313 | /* Release lock and exit. */ | 312 | /* Release lock and exit. */ |
314 | mutex_unlock(&lguest_lock); | 313 | mutex_unlock(&lguest_lock); |
315 | 314 | ||