Messages in this thread Patch in this message | | | From | "Rafael J. Wysocki" <> | Subject | [PATCH] swsusp: do not leak memory if there's an error during suspend | Date | Sat, 19 Mar 2005 15:35:53 +0100 |
| |
Hi,
The following patch prevents swsusp from leaking memory if there's an error during suspend (eg when device_power_down() returns non-zero).
Greets, Rafael
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
--- linux-2.6.12-rc1-a/kernel/power/swsusp.c 2005-03-19 11:51:02.000000000 +0100 +++ linux-2.6.12-rc1-b/kernel/power/swsusp.c 2005-03-19 15:16:56.000000000 +0100 @@ -894,10 +894,12 @@ int swsusp_suspend(void) */ if ((error = device_power_down(PMSG_FREEZE))) { local_irq_enable(); + swsusp_free(); return error; } save_processor_state(); - error = swsusp_arch_suspend(); + if ((error = swsusp_arch_suspend())) + swsusp_free(); /* Restore control flow magically appears here */ restore_processor_state(); BUG_ON (nr_copy_pages_check != nr_copy_pages); -- - Would you tell me, please, which way I ought to go from here? - That depends a good deal on where you want to get to. -- Lewis Carroll "Alice's Adventures in Wonderland" - 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/
| |