swsusp: do not leak memory if there's an error during suspend
Subsystems (2)
PATCH 1/1 swsusp: do not leak memory if there's an error during suspend
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 <[email protected]>
kernel/power/swsusp.c +3 -1
@@ -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);
Signature · 3 lines
- 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"