Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pci-v5.15-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull pci fix from Bjorn Helgaas:

- Don't save msi_populate_sysfs() error code as dev->msi_irq_groups so
we don't dereference the error code as a pointer (Wang Hai)

* tag 'pci-v5.15-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI/MSI: Handle msi_populate_sysfs() errors correctly

+12 -6
+12 -6
drivers/pci/msi.c
··· 535 535 static int msi_capability_init(struct pci_dev *dev, int nvec, 536 536 struct irq_affinity *affd) 537 537 { 538 + const struct attribute_group **groups; 538 539 struct msi_desc *entry; 539 540 int ret; 540 541 ··· 559 558 if (ret) 560 559 goto err; 561 560 562 - dev->msi_irq_groups = msi_populate_sysfs(&dev->dev); 563 - if (IS_ERR(dev->msi_irq_groups)) { 564 - ret = PTR_ERR(dev->msi_irq_groups); 561 + groups = msi_populate_sysfs(&dev->dev); 562 + if (IS_ERR(groups)) { 563 + ret = PTR_ERR(groups); 565 564 goto err; 566 565 } 566 + 567 + dev->msi_irq_groups = groups; 567 568 568 569 /* Set MSI enabled bits */ 569 570 pci_intx_for_msi(dev, 0); ··· 694 691 static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries, 695 692 int nvec, struct irq_affinity *affd) 696 693 { 694 + const struct attribute_group **groups; 697 695 void __iomem *base; 698 696 int ret, tsize; 699 697 u16 control; ··· 734 730 735 731 msix_update_entries(dev, entries); 736 732 737 - dev->msi_irq_groups = msi_populate_sysfs(&dev->dev); 738 - if (IS_ERR(dev->msi_irq_groups)) { 739 - ret = PTR_ERR(dev->msi_irq_groups); 733 + groups = msi_populate_sysfs(&dev->dev); 734 + if (IS_ERR(groups)) { 735 + ret = PTR_ERR(groups); 740 736 goto out_free; 741 737 } 738 + 739 + dev->msi_irq_groups = groups; 742 740 743 741 /* Set MSI-X enabled bits and unmask the function */ 744 742 pci_intx_for_msi(dev, 0);