Unverified Commit fbcd4a30 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4845 PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource()

parents 236cb940 aa5f1199
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -2143,12 +2143,12 @@ int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma);

#define __pci_dev_for_each_res0(dev, res, ...)				  \
	for (unsigned int __b = 0;					  \
	     res = pci_resource_n(dev, __b), __b < PCI_NUM_RESOURCES;	\
	     __b < PCI_NUM_RESOURCES && (res = pci_resource_n(dev, __b)); \
	     __b++)

#define __pci_dev_for_each_res1(dev, res, __b)				  \
	for (__b = 0;							  \
	     res = pci_resource_n(dev, __b), __b < PCI_NUM_RESOURCES;	\
	     __b < PCI_NUM_RESOURCES && (res = pci_resource_n(dev, __b)); \
	     __b++)

#define pci_dev_for_each_resource(dev, res, ...)			\