提交 f2d61379 编写于 作者: R Rafael J. Wysocki 提交者: Linus Torvalds

[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: NRafael J. Wysocki <rjw@sisk.pl>
Acked-by: NPavel Machek <pavel@ucw.cz>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 254b5477
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册