Commit f82a9fc2 authored by leoliu-oc's avatar leoliu-oc
Browse files

perf/x86/zhaoxin/uncore: add NULL pointer check after kzalloc

zhaoxin inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I90GXO


CVE: NA

-----------------

Add NULL pointer check after kzalloc in uncore_pci_probe().

Signed-off-by: default avatarleoliu-oc <leoliu-oc@zhaoxin.com>
parent dea3a65a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1591,6 +1591,8 @@ static int uncore_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id
		loop = 1;

	boxes = kzalloc(loop * sizeof(struct zhaoxin_uncore_box *), GFP_KERNEL);
	if (!boxes)
		return -ENOMEM;

	for (i = 0; i < loop; i++) {
		type = uncore_pci_uncores[UNCORE_PCI_DEV_TYPE(id->driver_data) + j];