Commit 1f1b0008e8dd1930d6e89522c70f4a438374302a
1 parent
ead88af5f5
Exists in
master
and in
7 other branches
[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>
Showing 4 changed files with 11 additions and 7 deletions Side-by-side Diff
fs/logfs/logfs.h
fs/logfs/readwrite.c
... | ... | @@ -2243,9 +2243,7 @@ |
2243 | 2243 | struct logfs_super *super = logfs_super(sb); |
2244 | 2244 | |
2245 | 2245 | destroy_meta_inode(super->s_segfile_inode); |
2246 | - if (super->s_block_pool) | |
2247 | - mempool_destroy(super->s_block_pool); | |
2248 | - if (super->s_shadow_pool) | |
2249 | - mempool_destroy(super->s_shadow_pool); | |
2246 | + logfs_mempool_destroy(super->s_block_pool); | |
2247 | + logfs_mempool_destroy(super->s_shadow_pool); | |
2250 | 2248 | } |
fs/logfs/segment.c
fs/logfs/super.c
... | ... | @@ -517,8 +517,8 @@ |
517 | 517 | if (super->s_erase_page) |
518 | 518 | __free_page(super->s_erase_page); |
519 | 519 | super->s_devops->put_device(sb); |
520 | - mempool_destroy(super->s_btree_pool); | |
521 | - mempool_destroy(super->s_alias_pool); | |
520 | + logfs_mempool_destroy(super->s_btree_pool); | |
521 | + logfs_mempool_destroy(super->s_alias_pool); | |
522 | 522 | kfree(super); |
523 | 523 | log_super("LogFS: Finished unmounting\n"); |
524 | 524 | } |