Skip to content

Commit 836eec3

Browse files
committed
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()
2 parents da72dcc + e51d05f commit 836eec3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,8 +1200,8 @@ static int ks_pcie_probe(struct platform_device *pdev)
12001200
if (irq < 0)
12011201
return irq;
12021202

1203-
ret = request_irq(irq, ks_pcie_err_irq_handler, IRQF_SHARED,
1204-
"ks-pcie-error-irq", ks_pcie);
1203+
ret = devm_request_irq(dev, irq, ks_pcie_err_irq_handler, IRQF_SHARED,
1204+
"ks-pcie-error-irq", ks_pcie);
12051205
if (ret < 0) {
12061206
dev_err(dev, "failed to request error IRQ %d\n",
12071207
irq);
@@ -1212,11 +1212,11 @@ static int ks_pcie_probe(struct platform_device *pdev)
12121212
if (ret)
12131213
num_lanes = 1;
12141214

1215-
phy = devm_kzalloc(dev, sizeof(*phy) * num_lanes, GFP_KERNEL);
1215+
phy = devm_kcalloc(dev, num_lanes, sizeof(*phy), GFP_KERNEL);
12161216
if (!phy)
12171217
return -ENOMEM;
12181218

1219-
link = devm_kzalloc(dev, sizeof(*link) * num_lanes, GFP_KERNEL);
1219+
link = devm_kcalloc(dev, num_lanes, sizeof(*link), GFP_KERNEL);
12201220
if (!link)
12211221
return -ENOMEM;
12221222

0 commit comments

Comments
 (0)