From 41a7f8cbeeaf8cbaf23af6ed57ef49a926a2bd16 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 7 Feb 2019 19:44:04 -0800 Subject: [PATCH] bus/vmbus: stop mapping if empty resource found If vmbus is run on older kernel (without all the uio mappings), then the bus driver should stop when it hits the missing mappings rather than recording the empty values. Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/bus/vmbus/vmbus_common_uio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bus/vmbus/vmbus_common_uio.c b/drivers/bus/vmbus/vmbus_common_uio.c index 46e233d9fa..a6545b758e 100644 --- a/drivers/bus/vmbus/vmbus_common_uio.c +++ b/drivers/bus/vmbus/vmbus_common_uio.c @@ -98,9 +98,9 @@ vmbus_uio_map_primary(struct rte_vmbus_device *dev) /* Map the resources */ for (i = 0; i < VMBUS_MAX_RESOURCE; i++) { - /* skip empty BAR */ + /* stop at empty BAR */ if (dev->resource[i].len == 0) - continue; + break; ret = vmbus_uio_map_resource_by_index(dev, i, uio_res, 0); if (ret) -- 2.20.1