On 2023/4/6 16:56, Dan Carpenter wrote:
It's just always better to use kcalloc() instead of open coding the
size calculation.
Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>
Another thing I always forgot...
Thanks,
Qu
---
fs/btrfs/scrub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index ccb4f58ae307..6afb0abc83ce 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -254,7 +254,7 @@ static int init_scrub_stripe(struct btrfs_fs_info *fs_info,
if (!stripe->sectors)
goto error;
- stripe->csums = kzalloc((BTRFS_STRIPE_LEN >> fs_info->sectorsize_bits) *
+ stripe->csums = kcalloc((BTRFS_STRIPE_LEN >> fs_info->sectorsize_bits),
fs_info->csum_size, GFP_KERNEL);
if (!stripe->csums)
goto error;