Skip to content

Commit a91c6db

Browse files
committed
Merge branch 'pci/ctrl/vmd'
- Use devm_kasprintf() instead of simple kasprintf() (Subramanian Mohan) - Add [8086:7D0B] and [8086:AD0B] devices to VMD driver (Francisco Munoz) * pci/ctrl/vmd: PCI: vmd: Add DID 8086:7D0B and 8086:AD0B for Intel MTL SKUs PCI: vmd: Use devm_kasprintf() instead of simple kasprintf()
2 parents 64451ac + 57a128a commit a91c6db

File tree

1 file changed

+10
-3
lines changed
  • drivers/pci/controller

1 file changed

+10
-3
lines changed

drivers/pci/controller/vmd.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,8 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
898898
if (vmd->instance < 0)
899899
return vmd->instance;
900900

901-
vmd->name = kasprintf(GFP_KERNEL, "vmd%d", vmd->instance);
901+
vmd->name = devm_kasprintf(&dev->dev, GFP_KERNEL, "vmd%d",
902+
vmd->instance);
902903
if (!vmd->name) {
903904
err = -ENOMEM;
904905
goto out_release_instance;
@@ -936,7 +937,6 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
936937

937938
out_release_instance:
938939
ida_simple_remove(&vmd_instance_ida, vmd->instance);
939-
kfree(vmd->name);
940940
return err;
941941
}
942942

@@ -959,7 +959,6 @@ static void vmd_remove(struct pci_dev *dev)
959959
vmd_detach_resources(vmd);
960960
vmd_remove_irq_domain(vmd);
961961
ida_simple_remove(&vmd_instance_ida, vmd->instance);
962-
kfree(vmd->name);
963962
}
964963

965964
#ifdef CONFIG_PM_SLEEP
@@ -1013,6 +1012,14 @@ static const struct pci_device_id vmd_ids[] = {
10131012
.driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
10141013
VMD_FEAT_HAS_BUS_RESTRICTIONS |
10151014
VMD_FEAT_OFFSET_FIRST_VECTOR,},
1015+
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7d0b),
1016+
.driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
1017+
VMD_FEAT_HAS_BUS_RESTRICTIONS |
1018+
VMD_FEAT_OFFSET_FIRST_VECTOR,},
1019+
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xad0b),
1020+
.driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
1021+
VMD_FEAT_HAS_BUS_RESTRICTIONS |
1022+
VMD_FEAT_OFFSET_FIRST_VECTOR,},
10161023
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_VMD_9A0B),
10171024
.driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
10181025
VMD_FEAT_HAS_BUS_RESTRICTIONS |

0 commit comments

Comments
 (0)