summaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2005-09-27 21:45:32 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-28 07:46:40 -0700
commitf2d613799af915da1fd78463ba8ec5086a0d6f92 (patch)
treedba02c1108bd9e101ce4986c458a2fa2a400eb56 /kernel/power
parent254b54771cc4c00002f796be65d2885191dca9dc (diff)
downloadlwn-f2d613799af915da1fd78463ba8ec5086a0d6f92.tar.gz
lwn-f2d613799af915da1fd78463ba8ec5086a0d6f92.zip
[PATCH] swsusp: prevent possible memory leak
Prevent 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. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/swsusp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index 8aef1b49150f..0dfb24948907 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -1437,9 +1437,9 @@ static int read_pagedir(struct pbe *pblist)
}
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;
}