Skip to content

Commit

Permalink
infra: fix null ptr access
Browse files Browse the repository at this point in the history
Fix null ptr access

Fixes: 8beb4d9 ("infra: destroy ports after logical interfaces")
Signed-off-by: Christophe Fontaine <[email protected]>
  • Loading branch information
christophefontaine authored and rjarry committed Jul 24, 2024
1 parent b7f27e2 commit c7fcf4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/infra/control/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static void iface_fini(struct event_base *) {
// Destroy all virtual interface first before removing DPDK ports.
for (ifid = 0; ifid < MAX_IFACES; ifid++) {
iface = ifaces[ifid];
if (iface != NULL || iface->type_id != GR_IFACE_TYPE_PORT) {
if (iface != NULL && iface->type_id != GR_IFACE_TYPE_PORT) {
if (iface_destroy(ifid) < 0)
LOG(ERR, "iface_destroy: %s", strerror(errno));
ifaces[ifid] = NULL;
Expand Down

0 comments on commit c7fcf4b

Please sign in to comment.