From: Phillip Lougher <phillip@squashfs.org.uk>
To: Colin Ian King <colin.i.king@gmail.com>, Chanho Min <chanho.min@lge.com>
Cc: kernel-janitors@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] squashfs: Fix incorrect argument to sizeof in kmalloc_array call
Date: Tue, 8 Jul 2025 20:05:10 +0100 [thread overview]
Message-ID: <47a56ddc-eedc-40f4-a7a1-1aeea6224e1c@squashfs.org.uk> (raw)
In-Reply-To: <20250708142604.1891156-1-colin.i.king@gmail.com>
On 08/07/2025 15:26, Colin Ian King wrote:
> The sizeof(void *) is the incorrect argument in the kmalloc_array call,
> it best to fix this by using sizeof(*folio) instead. Fortunately the
> sizes of void * and *folio happen to be the same, so this has not shown
> up as a run time issue.
>
> Fixes: 2e227ff5e272 ("squashfs: add optional full compressed block caching")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Thanks
Reviewed-by: Phillip Lougher <phillip@squashfs.org.uk>
> ---
> fs/squashfs/block.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c
> index b3ae3b1cc0e5..00049b7b10c8 100644
> --- a/fs/squashfs/block.c
> +++ b/fs/squashfs/block.c
> @@ -89,7 +89,7 @@ static int squashfs_bio_read_cached(struct bio *fullbio,
> int err = 0;
> #ifdef CONFIG_SQUASHFS_COMP_CACHE_FULL
> struct folio **cache_folios = kmalloc_array(page_count,
> - sizeof(void *), GFP_KERNEL | __GFP_ZERO);
> + sizeof(*folio), GFP_KERNEL | __GFP_ZERO);
> #endif
>
> bio_for_each_folio_all(fi, fullbio) {
next prev parent reply other threads:[~2025-07-08 19:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-08 14:26 Colin Ian King
2025-07-08 19:05 ` Phillip Lougher [this message]
2025-07-09 1:05 ` kernel test robot
2025-07-09 2:54 ` Andrew Morton
2025-07-09 17:03 ` Christophe JAILLET
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47a56ddc-eedc-40f4-a7a1-1aeea6224e1c@squashfs.org.uk \
--to=phillip@squashfs.org.uk \
--cc=akpm@linux-foundation.org \
--cc=chanho.min@lge.com \
--cc=colin.i.king@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®