This is a note to let you know that I've just added the patch titled PCI: of_property: Return error for int_map allocation failure to the 6.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: pci-of_property-return-error-for-int_map-allocation-.patch and it can be found in the queue-6.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 6143810f5df627b5ca920daa6fbb8ec16f313da0 Author: Duoming Zhou <duoming@xxxxxxxxxx> Date: Sun Mar 3 18:57:29 2024 +0800 PCI: of_property: Return error for int_map allocation failure [ Upstream commit e6f7d27df5d208b50cae817a91d128fb434bb12c ] Return -ENOMEM from of_pci_prop_intr_map() if kcalloc() fails to prevent a NULL pointer dereference in this case. Fixes: 407d1a51921e ("PCI: Create device tree node for bridge") Link: https://lore.kernel.org/r/20240303105729.78624-1-duoming@xxxxxxxxxx Signed-off-by: Duoming Zhou <duoming@xxxxxxxxxx> [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/pci/of_property.c b/drivers/pci/of_property.c index c2c7334152bc0..03539e5053720 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) {