]> git.itanic.dy.fi Git - linux-stable/commit
PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 26 Jan 2024 08:40:37 +0000 (11:40 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 7 Feb 2024 19:09:02 +0000 (13:09 -0600)
commitb5d1b4b46f856da1473c7ba9a5cdfcb55c9b2478
treedbcb27cef1bd09a3347fb71e9d0743457c5d4857
parent6613476e225e090cc9aad49be7fa504e290dd33d
PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq()

The "msg_addr" variable is u64.  However, the "aligned_offset" is an
unsigned int.  This means that when the code does:

  msg_addr &= ~aligned_offset;

it will unintentionally zero out the high 32 bits.  Use ALIGN_DOWN() to do
the alignment instead.

Fixes: 2217fffcd63f ("PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support")
Link: https://lore.kernel.org/r/af59c7ad-ab93-40f7-ad4a-7ac0b14d37f5@moroto.mountain
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: <stable@vger.kernel.org>
drivers/pci/controller/dwc/pcie-designware-ep.c