Skip to content

Commit

Permalink
pci:map bar should not be zaro len
Browse files Browse the repository at this point in the history
Signed-off-by: lipengfei28 <[email protected]>
  • Loading branch information
lipengfei28 committed Nov 28, 2024
1 parent 6dcc1d1 commit 21343f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,12 @@ FAR void *pci_map_bar_region(FAR struct pci_device_s *dev, int bar,
uintptr_t offset, size_t length)
{
uintptr_t start = pci_resource_start(dev, bar) + offset;

if (pci_resource_len(dev, bar) == 0)
{
return NULL;
}

return pci_map_region(dev, start, length);
}

Expand Down

0 comments on commit 21343f6

Please sign in to comment.