diff options
author | Phillip Lougher <phillip@squashfs.org.uk> | 2022-08-22 23:54:30 +0200 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2022-08-28 23:02:45 +0200 |
commit | 1f13dff09ffc8bcf6aa20639b638d813379c7f6b (patch) | |
tree | b5fea4fe8fed9c9688db989c1ce7a6dafc0a4759 /fs/squashfs/page_actor.h | |
parent | mm/damon/dbgfs: avoid duplicate context directory creation (diff) | |
download | linux-1f13dff09ffc8bcf6aa20639b638d813379c7f6b.tar.xz linux-1f13dff09ffc8bcf6aa20639b638d813379c7f6b.zip |
squashfs: don't call kmalloc in decompressors
The decompressors may be called while in an atomic section. So move the
kmalloc() out of this path, and into the "page actor" init function.
This fixes a regression introduced by commit
f268eedddf35 ("squashfs: extend "page actor" to handle missing pages")
Link: https://lkml.kernel.org/r/20220822215430.15933-1-phillip@squashfs.org.uk
Fixes: f268eedddf35 ("squashfs: extend "page actor" to handle missing pages")
Reported-by: Chris Murphy <lists@colorremedies.com>
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/squashfs/page_actor.h')
-rw-r--r-- | fs/squashfs/page_actor.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/squashfs/page_actor.h b/fs/squashfs/page_actor.h index 24841d28bc0f..95ffbb543d91 100644 --- a/fs/squashfs/page_actor.h +++ b/fs/squashfs/page_actor.h @@ -29,6 +29,11 @@ extern struct squashfs_page_actor *squashfs_page_actor_init(void **buffer, extern struct squashfs_page_actor *squashfs_page_actor_init_special( struct squashfs_sb_info *msblk, struct page **page, int pages, int length); +static inline void squashfs_page_actor_free(struct squashfs_page_actor *actor) +{ + kfree(actor->tmp_buffer); + kfree(actor); +} static inline void *squashfs_first_page(struct squashfs_page_actor *actor) { return actor->squashfs_first_page(actor); |