From: Jay Ding <jay.d...@broadcom.com>

rte_eth_dev_info_get() could fail due to device reset, etc.

The return value should be checked before the device info
pointer is dereferenced.

Fixes: 2f196c80e716 ("netdev-dpdk: Use LSC interrupt mode.")
Signed-off-by: Jay Ding <jay.d...@broadcom.com>
---
 lib/netdev-dpdk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 549887b31..35cd2ae17 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -2424,5 +2424,6 @@ netdev_dpdk_set_config(struct netdev *netdev, const 
struct smap *args,
 
     lsc_interrupt_mode = smap_get_bool(args, "dpdk-lsc-interrupt", true);
-    if (lsc_interrupt_mode && !(*info.dev_flags & RTE_ETH_DEV_INTR_LSC)) {
+    if (lsc_interrupt_mode && !ret &&
+            !(*info.dev_flags & RTE_ETH_DEV_INTR_LSC)) {
         if (smap_get(args, "dpdk-lsc-interrupt")) {
             VLOG_WARN_BUF(errp, "'%s': link status interrupt is not "
-- 
2.48.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to