Messages in this thread Patch in this message | | | From | "Rafael J. Wysocki" <> | Subject | [PATCH 2/3][Fix] swsusp: prevent possible memory leak | Date | Sun, 25 Sep 2005 20:30:04 +0200 |
| |
The following patch prevents swsusp from leaking some memory in case of an error in read_pagedir(). It also prevents the BUG_ON() from triggering if there's an error while reading swap.
Please apply, Rafael
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Index: linux-2.6.14-rc2-git3/kernel/power/swsusp.c =================================================================== --- linux-2.6.14-rc2-git3.orig/kernel/power/swsusp.c 2005-09-25 18:49:00.000000000 +0200 +++ linux-2.6.14-rc2-git3/kernel/power/swsusp.c 2005-09-25 18:52:48.000000000 +0200 @@ -1437,9 +1437,9 @@ } if (error) - free_page((unsigned long)pblist); - - BUG_ON(i != swsusp_info.pagedir_pages); + free_pagedir(pblist); + else + BUG_ON(i != swsusp_info.pagedir_pages); return error; } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |