pci: map bar fix
spdk_map_bar_rte did not return error in case bar was not mapped successfully Signed-off-by: Lukasz Radomski <lukasz.radomski@intel.com> Change-Id: I662cc189d47c65af8f135a3ab4b27ff1785233d0 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477812 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
6b5f764856
commit
87f0dab8cf
@ -62,7 +62,15 @@ spdk_map_bar_rte(struct spdk_pci_device *device, uint32_t bar,
|
||||
struct rte_pci_device *dev = device->dev_handle;
|
||||
|
||||
*mapped_addr = dev->mem_resource[bar].addr;
|
||||
if (*mapped_addr == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
*phys_addr = (uint64_t)dev->mem_resource[bar].phys_addr;
|
||||
if (*phys_addr == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
*size = (uint64_t)dev->mem_resource[bar].len;
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user