lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6yaka4sjghyq727gyhlf3usu24amj3q46ckh24ukvx4kuffmfm@d3nwn34zwijt>
Date: Sun, 31 Aug 2025 16:50:09 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Alok Tiwari <alok.a.tiwari@...cle.com>
Cc: thierry.reding@...il.com, lpieralisi@...nel.org, 
	kwilczynski@...nel.org, robh@...nel.org, bhelgaas@...gle.com, jonathanh@...dia.com, 
	linux-tegra@...r.kernel.org, linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PCI: tegra: fix devm_kcalloc argument order for
 port->phys allocation

On Tue, Aug 19, 2025 at 08:04:08AM GMT, Alok Tiwari wrote:
> Fix incorrect argument order in devm_kcalloc() when allocating
> port->phys, The original call used sizeof(phy) as the number of
> elements and port->lanes as the element size, which is reversed.
> While this happens to produce the correct total allocation size with
> current pointer size and lane counts, the argument order is wrong.
> 
> Signed-off-by: Alok Tiwari <alok.a.tiwari@...cle.com>

Missing Fixes tag. I'll add it while applying.

- Mani

> ---
>  drivers/pci/controller/pci-tegra.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
> index 467ddc701adc..bb88767a3797 100644
> --- a/drivers/pci/controller/pci-tegra.c
> +++ b/drivers/pci/controller/pci-tegra.c
> @@ -1344,7 +1344,7 @@ static int tegra_pcie_port_get_phys(struct tegra_pcie_port *port)
>  	unsigned int i;
>  	int err;
>  
> -	port->phys = devm_kcalloc(dev, sizeof(phy), port->lanes, GFP_KERNEL);
> +	port->phys = devm_kcalloc(dev, port->lanes, sizeof(phy), GFP_KERNEL);
>  	if (!port->phys)
>  		return -ENOMEM;
>  
> -- 
> 2.50.1
> 

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ