From: Kriish Sharma <kriish.sharma2006@gmail.com>
To: Carlos Maiolino <cem@kernel.org>
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
skhan@linuxfoundation.org, david.hunter.linux@gmail.com,
Kriish Sharma <kriish.sharma2006@gmail.com>
Subject: [PATCH] xfs: use kmalloc_array() instead of kmalloc() for map allocation
Date: Sat, 18 Oct 2025 19:45:28 +0000 [thread overview]
Message-ID: <20251018194528.1871298-1-kriish.sharma2006@gmail.com> (raw)
Using kmalloc_array() better reflects the intent to allocate an array of
map entries, and improves consistency with similar allocations across the
kernel.
No functional change intended.
Signed-off-by: Kriish Sharma <kriish.sharma2006@gmail.com>
---
fs/xfs/xfs_qm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 23ba84ec919a..34ec61e455ff 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -1218,7 +1218,7 @@ xfs_qm_reset_dqcounts_buf(
if (qip->i_nblocks == 0)
return 0;
- map = kmalloc(XFS_DQITER_MAP_SIZE * sizeof(*map),
+ map = kmalloc_array(XFS_DQITER_MAP_SIZE, sizeof(*map),
GFP_KERNEL | __GFP_NOFAIL);
lblkno = 0;
--
2.34.1
next reply other threads:[~2025-10-18 19:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <eeslnTm4EeKA2atDj3UKUcXAaGwgiPzioO9tR3Kf0pBEyUjxEO_9DaFIpNYIlc_9ey63h8gqdBsIt9Xjgn7AkA==@protonmail.internalid>
2025-10-18 19:45 ` Kriish Sharma [this message]
2025-10-21 7:02 ` [PATCH] xfs: use kmalloc_array() instead of kmalloc() for map allocation Carlos Maiolino
2025-10-21 14:51 ` Darrick J. Wong
2025-10-24 6:49 ` Nirjhar Roy (IBM)
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=20251018194528.1871298-1-kriish.sharma2006@gmail.com \
--to=kriish.sharma2006@gmail.com \
--cc=cem@kernel.org \
--cc=david.hunter.linux@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=skhan@linuxfoundation.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;
as well as URLs for NNTP newsgroup(s).