aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/logfs.h
diff options
context:
space:
mode:
authorJoern Engel <joern@logfs.org>2010-04-15 02:03:57 -0400
committerJoern Engel <joern@logfs.org>2010-04-15 02:03:57 -0400
commit1f1b0008e8dd1930d6e89522c70f4a438374302a (patch)
treefb35404bdb4db79925891779e3be118eca8e85dd /fs/logfs/logfs.h
parentead88af5f577fd2b399a0fcdfe52605116fac489 (diff)
[LogFS] Prevent mempool_destroy NULL pointer dereference
It would probably be better to just accept NULL pointers in mempool_destroy(). But for the current -rc series let's keep things simple. This patch was lost in the cracks for a while. Kevin Cernekee <cernekee@gmail.com> had to rediscover the problem and send a similar patch because of it. :( Signed-off-by: Joern Engel <joern@logfs.org>
Diffstat (limited to 'fs/logfs/logfs.h')
-rw-r--r--fs/logfs/logfs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/logfs/logfs.h b/fs/logfs/logfs.h
index c9929eed80b1..0a3df1a0c936 100644
--- a/fs/logfs/logfs.h
+++ b/fs/logfs/logfs.h
@@ -727,4 +727,10 @@ static inline struct logfs_area *get_area(struct super_block *sb,
727 return logfs_super(sb)->s_area[(__force u8)gc_level]; 727 return logfs_super(sb)->s_area[(__force u8)gc_level];
728} 728}
729 729
730static inline void logfs_mempool_destroy(mempool_t *pool)
731{
732 if (pool)
733 mempool_destroy(pool);
734}
735
730#endif 736#endif