Blame SOURCES/0001-ecp-allow-for-failure-to-create.patch

78f543
From e00392c7b4fa1e1fa447c6e3c930a06263629e98 Mon Sep 17 00:00:00 2001
78f543
From: Aaron Conole <aconole@redhat.com>
78f543
Date: Wed, 31 Jul 2019 16:07:03 -0400
78f543
Subject: [PATCH] ecp: allow for failure to create
78f543
78f543
Sometimes when trying to create an ecp instance for an interface, the
78f543
interface information becomes invalid, or isn't available in a consumable
78f543
form.  This results in a null pointer being returned but the ecp create
78f543
routine can also return NULL.  The null condition from ecp_create isn't
78f543
checked which leads to SEGV.
78f543
78f543
Signed-off-by: Aaron Conole <aconole@redhat.com>
78f543
---
78f543
 qbg/ecp22.c | 4 ++++
78f543
 1 file changed, 4 insertions(+)
78f543
78f543
diff --git a/qbg/ecp22.c b/qbg/ecp22.c
78f543
index 90b87fe..6561d14 100644
78f543
--- a/qbg/ecp22.c
78f543
+++ b/qbg/ecp22.c
78f543
@@ -782,6 +782,10 @@ void ecp22_start(char *ifname)
78f543
 	ecp = find_ecpdata(ifname, eud);
78f543
 	if (!ecp)
78f543
 		ecp = ecp22_create(ifname, eud);
78f543
+	if (!ecp) {
78f543
+		LLDPAD_DBG("%s:%s failed creating ECP22 instance\n", __func__, ifname);
78f543
+		return;
78f543
+	}
78f543
 	ecp->max_retries = ECP22_MAX_RETRIES_DEFAULT;
78f543
 	ecp->max_rte = ECP22_ACK_TIMER_DEFAULT;
78f543
 	LIST_INIT(&ecp->inuse.head);
78f543
-- 
78f543
2.21.0
78f543