Skip to content

Commit 0bb65e3

Browse files
committed
Merge branch 'pci/p2pdma'
- Free struct p2p_pgmap, not a member within it, in the pci_p2pdma_add_resource() error path (Sungho Kim) - Make pci_has_p2pmem() static (Leon Romanovsky) * pci/p2pdma: PCI/P2PDMA: Reduce scope of pci_has_p2pmem() PCI/P2PDMA: Fix incorrect pointer usage in devm_kfree() call
2 parents 3cde1c3 + 54dbd2a commit 0bb65e3

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

drivers/pci/p2pdma.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ int pci_p2pdma_add_resource(struct pci_dev *pdev, int bar, size_t size,
360360
pages_free:
361361
devm_memunmap_pages(&pdev->dev, pgmap);
362362
pgmap_free:
363-
devm_kfree(&pdev->dev, pgmap);
363+
devm_kfree(&pdev->dev, p2p_pgmap);
364364
return error;
365365
}
366366
EXPORT_SYMBOL_GPL(pci_p2pdma_add_resource);
@@ -738,7 +738,7 @@ EXPORT_SYMBOL_GPL(pci_p2pdma_distance_many);
738738
* pci_has_p2pmem - check if a given PCI device has published any p2pmem
739739
* @pdev: PCI device to check
740740
*/
741-
bool pci_has_p2pmem(struct pci_dev *pdev)
741+
static bool pci_has_p2pmem(struct pci_dev *pdev)
742742
{
743743
struct pci_p2pdma *p2pdma;
744744
bool res;
@@ -750,7 +750,6 @@ bool pci_has_p2pmem(struct pci_dev *pdev)
750750

751751
return res;
752752
}
753-
EXPORT_SYMBOL_GPL(pci_has_p2pmem);
754753

755754
/**
756755
* pci_p2pmem_find_many - find a peer-to-peer DMA memory device compatible with

include/linux/pci-p2pdma.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ int pci_p2pdma_add_resource(struct pci_dev *pdev, int bar, size_t size,
2121
u64 offset);
2222
int pci_p2pdma_distance_many(struct pci_dev *provider, struct device **clients,
2323
int num_clients, bool verbose);
24-
bool pci_has_p2pmem(struct pci_dev *pdev);
2524
struct pci_dev *pci_p2pmem_find_many(struct device **clients, int num_clients);
2625
void *pci_alloc_p2pmem(struct pci_dev *pdev, size_t size);
2726
void pci_free_p2pmem(struct pci_dev *pdev, void *addr, size_t size);
@@ -45,10 +44,6 @@ static inline int pci_p2pdma_distance_many(struct pci_dev *provider,
4544
{
4645
return -1;
4746
}
48-
static inline bool pci_has_p2pmem(struct pci_dev *pdev)
49-
{
50-
return false;
51-
}
5247
static inline struct pci_dev *pci_p2pmem_find_many(struct device **clients,
5348
int num_clients)
5449
{

0 commit comments

Comments
 (0)