Merge pull request #12665 from opensourcerouting/cs-misc

lib,zebra: fix null dereference and remove dead code
This commit is contained in:
Mark Stapp 2023-01-19 11:28:58 -05:00 committed by GitHub
commit 11f4fa6fe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -1000,8 +1000,7 @@ lib_vrf_state_active_get_elem(struct nb_cb_get_elem_args *args)
struct vrf *vrfp = (struct vrf *)args->list_entry;
if (vrfp->status == VRF_ACTIVE)
return yang_data_new_bool(
args->xpath, vrfp->status == VRF_ACTIVE ? true : false);
return yang_data_new_bool(args->xpath, true);
return NULL;
}

View File

@ -1436,7 +1436,8 @@ static void zebra_if_netconf_update_ctx(struct zebra_dplane_ctx *ctx,
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug(
"%s: if %s(%u) zebra info pointer is NULL",
__func__, ifp->name, ifp->ifindex);
__func__, ifp ? ifp->name : "(null)",
ifp ? ifp->ifindex : ifindex);
return;
}
if (afi == AFI_IP) {