On Thursday 22 January 2009 13:41:28 Mark Wallis wrote:
>  From Rusty's tutorial, fix the memory leak in close() by using kfree instead 
> of just zeroing the memory.
> 
> Signed-off-by: Mark Wallis <lgu...@markwallis.id.au>

Hi Mark,

   A couple of points: the patch should be applicable with -p1, so this is
one directory too low.

> --- drivers/lguest/lguest_user.c.orig 2009-01-22 10:20:33.000000000 +1100
> +++ drivers/lguest/lguest_user.c      2009-01-22 10:55:57.000000000 +1100

And some whitespace damage has been done (tabs to spaces, spaces missing?)

> @@ -310,9 +310,8 @@
>        * kmalloc()ed string, either of which is ok to hand to kfree(). */
>       if (!IS_ERR(lg->dead))
>               kfree(lg->dead);
> -     /* We clear the entire structure, which also marks it as free for the
> -      * next user. */
> -     memset(lg, 0, sizeof(*lg));
> +     /* Free the memory allocated to the lguest_struct */
> +     kfree(lg);
>       /* Release lock and exit. */
>       mutex_unlock(&lguest_lock);
> 

Cheers,
Rusty.
_______________________________________________
Lguest mailing list
Lguest@ozlabs.org
https://ozlabs.org/mailman/listinfo/lguest

Reply via email to