diff options
| author | sarita patra <saritap@vmware.com> | 2022-04-04 03:53:36 -0700 |
|---|---|---|
| committer | sarita patra <saritap@vmware.com> | 2022-04-04 05:27:57 -0700 |
| commit | e2116917e579d52a27e64953161c24f0e5e4d551 (patch) | |
| tree | a35034a41bd4bdf8fe25bf8d13ef31cec2ee0941 /pimd/pim_vxlan.c | |
| parent | 96322c148bfc862a60cbd11bf03a0afab5da4b75 (diff) | |
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 <saritap@vmware.com>
Diffstat (limited to 'pimd/pim_vxlan.c')
| -rw-r--r-- | pimd/pim_vxlan.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
