]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: tegra: Fix devm_kcalloc() argument order for port->phys allocation
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Tue, 19 Aug 2025 15:04:08 +0000 (08:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2025 09:56:32 +0000 (11:56 +0200)
commit352f0a4c0d063be5a55f13ae68c4e7215d9e85d9
treed8cf6739b792ca24c08c2867e71b8a3ca40f1245
parent8edbe1eecf2f70ff3764c11808a7e36e8919c7b6
PCI: tegra: Fix devm_kcalloc() argument order for port->phys allocation

[ Upstream commit e1a8805e5d263453ad76a4f50ab3b1c18ea07560 ]

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.

Fixes: 6fe7c187e026 ("PCI: tegra: Support per-lane PHYs")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
[mani: added Fixes tag]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20250819150436.3105973-1-alok.a.tiwari@oracle.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/pci-tegra.c