[PATCH] md: define and use safe_put_page for md

md sometimes call put_page on NULL pointers (treating it like kfree).  This is
not safe, so define and use a 'safe_put_page' which checks for NULL.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
NeilBrown
2006-01-06 00:20:40 -08:00
committed by Linus Torvalds
parent 7dd5d34c6c
commit 1345b1d8ad
5 changed files with 15 additions and 12 deletions

View File

@@ -2072,8 +2072,7 @@ static int run(mddev_t *mddev)
abort:
if (conf) {
print_raid6_conf(conf);
if (conf->spare_page)
put_page(conf->spare_page);
safe_put_page(conf->spare_page);
kfree(conf->stripe_hashtbl);
kfree(conf);
}