Merge branch 'pci/controller/keystone'

- Use kcalloc() instead of kzalloc() to avoid potential integer overflow
  (Qianfeng Rong)

- Use devm_request_irq() so 'ks-pcie-error-irq' is freed when driver exits
  with error (Siddharth Vadapalli)

* pci/controller/keystone:
  PCI: keystone: Use devm_request_irq() to free "ks-pcie-error-irq" on exit
  PCI: keystone: Use kcalloc() instead of kzalloc()
This commit is contained in:
Bjorn Helgaas 2025-10-03 12:13:19 -05:00
commit 836eec3a7c

View File

@ -1200,8 +1200,8 @@ static int ks_pcie_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
ret = request_irq(irq, ks_pcie_err_irq_handler, IRQF_SHARED,
"ks-pcie-error-irq", ks_pcie);
ret = devm_request_irq(dev, irq, ks_pcie_err_irq_handler, IRQF_SHARED,
"ks-pcie-error-irq", ks_pcie);
if (ret < 0) {
dev_err(dev, "failed to request error IRQ %d\n",
irq);
@ -1212,11 +1212,11 @@ static int ks_pcie_probe(struct platform_device *pdev)
if (ret)
num_lanes = 1;
phy = devm_kzalloc(dev, sizeof(*phy) * num_lanes, GFP_KERNEL);
phy = devm_kcalloc(dev, num_lanes, sizeof(*phy), GFP_KERNEL);
if (!phy)
return -ENOMEM;
link = devm_kzalloc(dev, sizeof(*link) * num_lanes, GFP_KERNEL);
link = devm_kcalloc(dev, num_lanes, sizeof(*link), GFP_KERNEL);
if (!link)
return -ENOMEM;