mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-06 20:16:25 +00:00
Item cache might free null page on alloc error
The item cache allocates a page and a little tracking struct for each cached page. If the page allocation fails it might try to free a null page pointer, which isn't allowed. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -345,7 +345,8 @@ static struct cached_page *alloc_pg(struct super_block *sb, gfp_t gfp)
|
||||
page = alloc_page(GFP_NOFS | gfp);
|
||||
if (!page || !pg) {
|
||||
kfree(pg);
|
||||
__free_page(page);
|
||||
if (page)
|
||||
__free_page(page);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user