aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorGravatar Bjorn Helgaas <bhelgaas@google.com> 2024-05-16 18:14:11 -0500
committerGravatar Bjorn Helgaas <bhelgaas@google.com> 2024-05-16 18:14:11 -0500
commitcf29111d3e4a9ebe1cbe2b431274718506d69f10 (patch)
tree991ff78b41b8194a44b365e4282105eeb35d36cc /drivers/pci
parentMerge branch 'pci/msi' (diff)
parentPCI: of_property: Return error for int_map allocation failure (diff)
downloadlinux-cf29111d3e4a9ebe1cbe2b431274718506d69f10.tar.gz
linux-cf29111d3e4a9ebe1cbe2b431274718506d69f10.tar.bz2
linux-cf29111d3e4a9ebe1cbe2b431274718506d69f10.zip
Merge branch 'pci/of'
- Check for kcalloc() failure and handle it gracefully (Duoming Zhou) * pci/of: PCI: of_property: Return error for int_map allocation failure
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/of_property.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/of_property.c b/drivers/pci/of_property.c
index c2c7334152bc..03539e505372 100644
--- a/drivers/pci/of_property.c
+++ b/drivers/pci/of_property.c
@@ -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) {