From: Brett Holman Date: Fri, 10 Feb 2023 23:36:55 +0000 (-0700) Subject: bcachefs: Fix memleak in replicas_table_update() X-Git-Tag: io_uring-6.7-2023-11-10~119^2~571 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=d7afe651ffa29fca79725a3cf5580a3fd2421fed;p=linux-block.git bcachefs: Fix memleak in replicas_table_update() Signed-off-by: Brett Holman Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/replicas.c b/fs/bcachefs/replicas.c index 482bedf4be8b..3bff21959d98 100644 --- a/fs/bcachefs/replicas.c +++ b/fs/bcachefs/replicas.c @@ -299,13 +299,6 @@ static int replicas_table_update(struct bch_fs *c, memset(new_usage, 0, sizeof(new_usage)); - for (i = 0; i < ARRAY_SIZE(new_usage); i++) - if (!(new_usage[i] = __alloc_percpu_gfp(bytes, - sizeof(u64), GFP_KERNEL))) - goto err; - - memset(new_usage, 0, sizeof(new_usage)); - for (i = 0; i < ARRAY_SIZE(new_usage); i++) if (!(new_usage[i] = __alloc_percpu_gfp(bytes, sizeof(u64), GFP_KERNEL)))