[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0671bdc2-883e-4fb3-aa69-9e4d1579a38f@ti.com>
Date: Tue, 19 Aug 2025 18:48:33 +0530
From: Siddharth Vadapalli <s-vadapalli@...com>
To: Qianfeng Rong <rongqianfeng@...o.com>
CC: Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof
WilczyĆski <kwilczynski@...nel.org>,
Manivannan Sadhasivam
<mani@...nel.org>,
Rob Herring <robh@...nel.org>, Bjorn Helgaas
<bhelgaas@...gle.com>,
Niklas Cassel <cassel@...nel.org>,
Siddharth Vadapalli
<s-vadapalli@...com>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Hans Zhang
<18255117159@....com>,
Sergio Paracuellos <sergio.paracuellos@...il.com>,
"Jiri Slaby (SUSE)" <jirislaby@...nel.org>,
<linux-pci@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] PCI: keystone: Use kcalloc() instead of kzalloc()
On Tue, Aug 19, 2025 at 09:12:33PM +0800, Qianfeng Rong wrote:
> Replace calls of devm_kzalloc() with devm_kcalloc() in ks_pcie_probe().
> As noted in the kernel documentation [1], open-coded multiplication in
> allocator arguments is discouraged because it can lead to integer
> overflow.
>
> Using devm_kcalloc() provides built-in overflow protection, making the
> memory allocation safer when calculating the allocation size compared
> to explicit multiplication.
>
> [1]: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
>
> Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
> ---
> v2: Modified the commit message.
Reviewed-by: Siddharth Vadapalli <s-vadapalli@...com>
Regards,
Siddharth.
Powered by blists - more mailing lists