Skip to content

Commit

Permalink
Merge branch 'pci/of'
Browse files Browse the repository at this point in the history
- Check for kcalloc() failure and handle it gracefully (Duoming Zhou)

* pci/of:
  PCI: of_property: Return error for int_map allocation failure
  • Loading branch information
bjorn-helgaas committed May 16, 2024
2 parents ed11a28 + e6f7d27 commit cf29111
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/pci/of_property.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ static int of_pci_prop_intr_map(struct pci_dev *pdev, struct of_changeset *ocs,
return 0;

int_map = kcalloc(map_sz, sizeof(u32), GFP_KERNEL);
if (!int_map)
return -ENOMEM;
mapp = int_map;

list_for_each_entry(child, &pdev->subordinate->devices, bus_list) {
Expand Down

0 comments on commit cf29111

Please sign in to comment.