aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/swsusp.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2005-09-28 00:45:32 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-28 10:46:40 -0400
commitf2d613799af915da1fd78463ba8ec5086a0d6f92 (patch)
treedba02c1108bd9e101ce4986c458a2fa2a400eb56 /kernel/power/swsusp.c
parent254b54771cc4c00002f796be65d2885191dca9dc (diff)
[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/swsusp.c')
-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)
1437 } 1437 }
1438 1438
1439 if (error) 1439 if (error)
1440 free_page((unsigned long)pblist); 1440 free_pagedir(pblist);
1441 1441 else
1442 BUG_ON(i != swsusp_info.pagedir_pages); 1442 BUG_ON(i != swsusp_info.pagedir_pages);
1443 1443
1444 return error; 1444 return error;
1445} 1445}