Re: [PATCH 1/2] bcachefs: Using vmalloc_array() for array space allocation

2025-08-11 Thread Liao Yuanhong
On 8/11/2025 8:50 PM, Alan Huang wrote: [You don't often get email from mmpgour...@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] On Aug 11, 2025, at 20:09, Liao Yuanhong wrote: Replace kmalloc(size * sizeof) with kmalloc_array() for safer memory a

Re: [PATCH 1/2] bcachefs: Using vmalloc_array() for array space allocation

2025-08-11 Thread Alan Huang
On Aug 11, 2025, at 20:09, Liao Yuanhong wrote: > > Replace kmalloc(size * sizeof) with kmalloc_array() for safer memory > allocation and overflow prevention. > > Signed-off-by: Liao Yuanhong > --- > fs/bcachefs/btree_key_cache.c| 2 +- > fs/bcachefs/btree_trans_commit.c | 2 +- > 2 files cha

[PATCH 1/2] bcachefs: Using vmalloc_array() for array space allocation

2025-08-11 Thread Liao Yuanhong
Replace kmalloc(size * sizeof) with kmalloc_array() for safer memory allocation and overflow prevention. Signed-off-by: Liao Yuanhong --- fs/bcachefs/btree_key_cache.c| 2 +- fs/bcachefs/btree_trans_commit.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/bcachefs/b