Skip to content

Commit cf29111

Browse files
committed
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
2 parents ed11a28 + e6f7d27 commit cf29111

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/pci/of_property.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ static int of_pci_prop_intr_map(struct pci_dev *pdev, struct of_changeset *ocs,
238238
return 0;
239239

240240
int_map = kcalloc(map_sz, sizeof(u32), GFP_KERNEL);
241+
if (!int_map)
242+
return -ENOMEM;
241243
mapp = int_map;
242244

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

0 commit comments

Comments
 (0)