summaryrefslogtreecommitdiff
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorSven Peter <sven@svenpeter.dev>2023-03-11 16:34:53 +0300
committerKrzysztof Wilczyński <kwilczynski@kernel.org>2023-07-13 21:08:48 +0300
commitd8650c0c2aa2e413594e4cb0faafa9958c1d7782 (patch)
tree71d3dae4f020da3657036936ee78bfb46ef27bdb /mm/vmscan.c
parent06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 (diff)
downloadlinux-d8650c0c2aa2e413594e4cb0faafa9958c1d7782.tar.xz
PCI: apple: Initialize pcie->nvecs before use
The apple_pcie_setup_port() function computes ilog2(pcie->nvecs) to set up the number of MSIs available for each port. However, it's called before apple_msi_init(), which initializes pcie->nvecs. Luckily, pcie->nvecs is part of kzalloc()-ed structure and, as such, initialized as zero. ilog2(0) happens to be 0xffffffff which then simply configures more MSIs in hardware than we have. This doesn't break anything because we never hand out those vectors. Thus, swap the order of the two calls so that the correctly initialized value is then used. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20230311133453.63246-1-sven@svenpeter.dev Fixes: 476c41ed4597 ("PCI: apple: Implement MSI support") Signed-off-by: Sven Peter <sven@svenpeter.dev> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Eric Curtin <ecurtin@redhat.com>
Diffstat (limited to 'mm/vmscan.c')
0 files changed, 0 insertions, 0 deletions