Skip to content

Commit

Permalink
Merge branch 'pci/p2pdma'
Browse files Browse the repository at this point in the history
- Move struct dev_pagemap (a flexible structure) to end of struct
  pci_p2pdma_pagemap to avoid overwriting things after dev_pagemap
  (Gustavo A. R.  Silva)

* pci/p2pdma:
  PCI/P2PDMA: Remove redundant goto
  PCI/P2PDMA: Fix undefined behavior bug in struct pci_p2pdma_pagemap
  • Loading branch information
bjorn-helgaas committed Oct 28, 2023
2 parents adfe8d7 + 805b196 commit 2094918
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/pci/p2pdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ struct pci_p2pdma {
};

struct pci_p2pdma_pagemap {
struct dev_pagemap pgmap;
struct pci_dev *provider;
u64 bus_offset;
struct dev_pagemap pgmap;
};

static struct pci_p2pdma_pagemap *to_p2p_pgmap(struct dev_pagemap *pgmap)
Expand Down Expand Up @@ -837,7 +837,6 @@ void *pci_alloc_p2pmem(struct pci_dev *pdev, size_t size)
if (unlikely(!percpu_ref_tryget_live_rcu(ref))) {
gen_pool_free(p2pdma->pool, (unsigned long) ret, size);
ret = NULL;
goto out;
}
out:
rcu_read_unlock();
Expand Down

0 comments on commit 2094918

Please sign in to comment.