[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

@@ -626,8 +626,7 @@ static void bitmap_file_unmap(struct bitmap *bitmap)
kfree(map);
kfree(attr);
if (sb_page)
put_page(sb_page);
safe_put_page(sb_page);
}
static void bitmap_stop_daemon(struct bitmap *bitmap);