diff options
author | NeilBrown <neilb@suse.de> | 2006-01-06 09:20:40 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 17:34:07 +0100 |
commit | 1345b1d8adbdeceb1c871d9a4af5e2a700b341c6 (patch) | |
tree | 0da1db7d273752ad5281db415e9245f3f3a63383 /include | |
parent | [PATCH] md: remove inappropriate limits in md/bitmap configuration. (diff) | |
download | linux-1345b1d8adbdeceb1c871d9a4af5e2a700b341c6.tar.xz linux-1345b1d8adbdeceb1c871d9a4af5e2a700b341c6.zip |
[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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/raid/md_k.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index e559fb701aa1..12b3203e3419 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -324,5 +324,10 @@ do { \ __wait_event_lock_irq(wq, condition, lock, cmd); \ } while (0) +static inline void safe_put_page(struct page *p) +{ + if (p) put_page(p); +} + #endif |