From nobody Sat Jul 25 15:51:52 2026 Received: from mail-oo1-f48.google.com (mail-oo1-f48.google.com [209.85.161.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BDB40400979 for ; Thu, 16 Jul 2026 14:07:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784210842; cv=none; b=pWBJEn68ehJVQ6/NCmtlEY2kh4zxE3tv6X/3qDKn+7JC5znBAUtI28ZOz+tZUrxq6CYJyJYf0rvzmLQOWs9MaJ/YA7UNII38xbd8/NQs9QAql1Hw6rQRAMuOv/7rBmBOUyMHpr8QGPtu+DKEYNXmXeXXtxI/KH+dJmVFtdS5ljM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784210842; c=relaxed/simple; bh=btDASYGmUHm0kbqZqVMslt1hNdAlhelxO4Zl2zjuXKk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=idc7wFikSp3VDmi7nWvseTtM3Gh9Ww4U0TR9Fs71wN8Ee+p8rFBIOdaDRJQcYcbTEMUzgrd19i/5j9CX2o36F/rYfSX++/GBSYs8H469K/D/7OjIhZHkvhJGt7BsTo7hLydZR06WsQ0Ibr3p5IJaa+DiA94G6r8euYbKLcOjVO8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hfgnwZPX; arc=none smtp.client-ip=209.85.161.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hfgnwZPX" Received: by mail-oo1-f48.google.com with SMTP id 006d021491bc7-6a397db52c1so3469701eaf.2 for ; Thu, 16 Jul 2026 07:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784210840; x=1784815640; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=DvXtVlllukOnRfih22Iy0sMwC4UQkImczALyzy6unIk=; b=hfgnwZPXrRSRZVU1uPiEW/ACEJLJ2FsIfYtmEn1LlbaSCOkArC8t1ROI4enPnkk2oQ wQJKY8tf/kC8IiYCe7/PvHhkL95GCajV3OwPHGoNM/oUyvGJofhpCNGfWIXy+6R8II8I bBFdt05tiuAOP9Dn/izc7sz2MYeEJbQwNnDwiyau5VMQcT1woPgULithed3CWInDt2Bt EW5ORCzxFFjleaX+uge6jF9rP/l8MPZQG9gd5OOSR4dibDUEZXDDvn9ISGO20/TQDAYX oLmXOsrWrfIvhS4bpi9qpqKE3j0CJizYAci3AFwfS9zirKEvixfhykn6WBQ2GajDUGU9 kSuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784210840; x=1784815640; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=DvXtVlllukOnRfih22Iy0sMwC4UQkImczALyzy6unIk=; b=qcZI/gQPH8d9hDNuFvTrKTMvTR8BJQPWcHP0KMPBPsFPIKkXzwZG4WhBeO+C3+IalE Xuj0LN0qjM9VxH8gKb6JiGBmJwd9je6d6b5RZKRSathI0z1s1eDj92g9EDNgGOtW/F7Q WmWOYhYaaZ1b3FsFFBJm/8Io8gk9JE2nbZKC2vPcKKogvbx5yzImVFtgEO8ZTNdTuHHO vd0qMs3u410a/Tf9DGZo08EZArsng+xFSVj5P6u0M9nSzW1QdRD6kK6GF5qiLzxSW0eU YYpQSy5Bnzmk1TJaEZGMN28Ymuk4XsTO2H29x+S6UUNOWRJoxLfvZbBIKewgN+PP4Af+ ulNA== X-Forwarded-Encrypted: i=1; AHgh+Rr8BTVf7nsh9GKSZRdeO1LP40IbnbCt24+ZAft6rCaEcAyHzFB/JGh+Zz6Lzjxio4OujogqQffwgr+o4bI=@vger.kernel.org X-Gm-Message-State: AOJu0YxbNdjd+kEaAUN2b1W8KFcD4LJnr+s4dALlRp1dIT3G91x50Tf2 OZxGn6CCjVBbMHwzaTRjvGwNyRy4NI0hvF+ulby+qUj7kL83RBeVnA7q X-Gm-Gg: AfdE7ckGOnXlOtfhSxH53dIKaVHIBWoUmOcMokd5KcoPuW05tdeyxNf2NMNqOvE87je 5pNHePM8SpfVD3y4tSPy7LTurm5QdUhY4X6FpFWl0PNoxcawo/eAFbuhV5HStDyQeHgji4F/qSu GcwwyAVQ9JYF4M12A7s14qspYw835DLE6MFWRyIGX1iY6rrQ/6Ewn1frJQ+xTUTLxS23T1HiK+V 0mbU0oJGr+61lExTJwnTPzaYeRco0D3fzoZAbtImYvlRnwtCVupqLAXfXMKr91YQg+Mp7rSVE5Y zCRKFMwSiOYmf5ufTblq6rl11LJi3F3FMymuxhsYv8hhmYx5HPa22Vshr+tBiSNWrulrplf2swI gBJdGu7cJ3HzUT5NvNlpdP+KKd9parez/msVURk9manKMONnWPEqRFHg5QiyFKQDD1SVHuWqfvv yF4QIk X-Received: by 2002:a05:6820:1849:b0:6a1:5b81:6168 with SMTP id 006d021491bc7-6a3d9ff3481mr4711592eaf.43.1784210839559; Thu, 16 Jul 2026 07:07:19 -0700 (PDT) Received: from [127.0.1.1] ([2404:f801:8028:3:3a49:ef75:fe4d:f2de]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4561f2680d8sm6165821fac.14.2026.07.16.07.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2026 07:07:18 -0700 (PDT) From: Subasri S Date: Thu, 16 Jul 2026 19:37:10 +0530 Subject: [PATCH nf-next] ipvs: use type-safe allocation helpers in ip_vs_rht_alloc Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260716-nf-next-ipvs-deprecated-v1-1-4aad24f87cb8@gmail.com> X-B4-Tracking: v=1; b=H4sIAI3lWGoC/x2MQQqAMAwEvyI5G9BYqvgV8VBs1FxqaUWE0r8bP A47OwUyJ+EMc1Mg8SNZrqDQtw1spwsHo3hloI5sN/YGw46B3xslPhk9x8Sbu9kjDWStCuQnA/r WYZf3Ly9rrR8ddPZwaQAAAA== To: Simon Horman , Julian Anastasov , Pablo Neira Ayuso , Florian Westphal , Phil Sutter , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-kernel@vger.kernel.org, Subasri S X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784210833; l=2187; i=subasris1210@gmail.com; s=20260709; h=from:subject:message-id; bh=btDASYGmUHm0kbqZqVMslt1hNdAlhelxO4Zl2zjuXKk=; b=Fb9gx7V7iND+52cndnRympWJA22Qo7oksacuKyuXDHMsdPX/+C7HGQ88QkqJD9Q/eI1afbFxL GkGcJvV3flGDbgun621aJoYoJuwKoscppT+00QUbKBOSMu+PWtfuMKZ X-Developer-Key: i=subasris1210@gmail.com; a=ed25519; pk=6C4wavGFy/OsR8yQQKNWuDXoYPHp2L3sfgNfyzTruTk= As per Documentation/process/deprecated.rst, open-coded kmalloc assignments for struct objects are deprecated. Replace kzalloc(sizeof(*ptr), GFP_KERNEL) with kzalloc_obj() and kvmalloc_array(n, sizeof(*ptr), GFP_KERNEL) with kvmalloc_objs() in ip_vs_rht_alloc(). Compile tested with CONFIG_IP_VS=3Dy and runtime tested using tools/testing/selftests/net/netfilter/ipvs.sh on x86_64/QEMU. Signed-off-by: Subasri S Acked-by: Julian Anastasov Reviewed-by: Phil Sutter --- net/netfilter/ipvs/ip_vs_core.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_cor= e.c index 35cbe821c259..74047bf1e32d 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c @@ -176,7 +176,7 @@ void ip_vs_rht_rcu_free(struct rcu_head *head) =20 struct ip_vs_rht *ip_vs_rht_alloc(int buckets, int scounts, int locks) { - struct ip_vs_rht *t =3D kzalloc(sizeof(*t), GFP_KERNEL); + struct ip_vs_rht *t =3D kzalloc_obj(*t); int i; =20 if (!t) @@ -186,7 +186,7 @@ struct ip_vs_rht *ip_vs_rht_alloc(int buckets, int scou= nts, int locks) =20 scounts =3D min(scounts, buckets); scounts =3D min(scounts, ml); - t->seqc =3D kvmalloc_array(scounts, sizeof(*t->seqc), GFP_KERNEL); + t->seqc =3D kvmalloc_objs(*t->seqc, scounts); if (!t->seqc) goto err; for (i =3D 0; i < scounts; i++) @@ -194,8 +194,7 @@ struct ip_vs_rht *ip_vs_rht_alloc(int buckets, int scou= nts, int locks) =20 if (locks) { locks =3D min(locks, scounts); - t->lock =3D kvmalloc_array(locks, sizeof(*t->lock), - GFP_KERNEL); + t->lock =3D kvmalloc_objs(*t->lock, locks); if (!t->lock) goto err; for (i =3D 0; i < locks; i++) @@ -203,7 +202,7 @@ struct ip_vs_rht *ip_vs_rht_alloc(int buckets, int scou= nts, int locks) } } =20 - t->buckets =3D kvmalloc_array(buckets, sizeof(*t->buckets), GFP_KERNEL); + t->buckets =3D kvmalloc_objs(*t->buckets, buckets); if (!t->buckets) goto err; for (i =3D 0; i < buckets; i++) --- base-commit: f6f3b36c15ed44de1fbb44e645e4fae8c4a4453e change-id: 20260714-nf-next-ipvs-deprecated-232667142d84 Best regards, --=20 Subasri S