Messages in this thread Patch in this message | | | From | "Leon M. George" <> | Subject | [PATCH] squashfs: free page if bio_add_page fails | Date | Fri, 13 May 2022 12:57:09 +0200 |
| |
In squashfs_bio_read, the page recently allocated for use with bio_add_page isn't freed when the call fails.
This patch adds a call to __free_page.
Signed-off-by: Leon M. George <leon@georgemail.eu> --- fs/squashfs/block.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c index 622c844f6d11..5ca1c9caef7d 100644 --- a/fs/squashfs/block.c +++ b/fs/squashfs/block.c @@ -110,6 +110,7 @@ static int squashfs_bio_read(struct super_block *sb, u64 index, int length, } if (!bio_add_page(bio, page, len, offset)) { error = -EIO; + __free_page(page); goto out_free_bio; } offset = 0; -- 2.35.1
| |