From: sarita patra Date: Mon, 4 Apr 2022 10:53:36 +0000 (-0700) Subject: pimd: fix pim_instance NULL deference in pim_vxlan_mlag_update X-Git-Tag: pim6-testing-20220430~100^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=e2116917e579d52a27e64953161c24f0e5e4d551;p=matthieu%2Ffrr.git pimd: fix pim_instance NULL deference in pim_vxlan_mlag_update Fixing the below coverity issue. >>> CID 1515545: (NULL_RETURNS) >>> Dereferencing a pointer that might be "NULL" "pim" when calling "pim_vxlan_set_peerlink_rif". 902 pim_vxlan_set_peerlink_rif(pim, NULL); Signed-off-by: sarita patra --- diff --git a/pimd/pim_vxlan.c b/pimd/pim_vxlan.c index 5e55b9f9c8..e4d969daee 100644 --- a/pimd/pim_vxlan.c +++ b/pimd/pim_vxlan.c @@ -880,6 +880,12 @@ void pim_vxlan_mlag_update(bool enable, bool peer_state, uint32_t role, */ pim = pim_get_pim_instance(VRF_DEFAULT); + if (!pim) { + if (PIM_DEBUG_VXLAN) + zlog_debug("%s: Unable to find pim instance", __func__); + return; + } + if (enable) vxlan_mlag.flags |= PIM_VXLAN_MLAGF_ENABLED; else