Message ID | 20240820131444.1724438-8-mkp@redhat.com |
---|---|
State | Superseded, archived |
Headers | show |
Series | Address clang analyze warnings. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | warning | apply and check: warning |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
On Tue, Aug 20, 2024 at 09:14:43AM -0400, Mike Pattrick wrote: > Previously error codes from group_get_lru() were ignored, possibly > causing NULL pointer dereferencing. This patch appropriately checks for > errors. > > Fixes: 4a95091d1f66 ("lib: Add IGMP snooping library bits") > Signed-off-by: Mike Pattrick <mkp@redhat.com> Acked-by: Simon Horman <horms@ovn.org>
diff --git a/lib/mcast-snooping.c b/lib/mcast-snooping.c index dc5164b41..bf25e6f20 100644 --- a/lib/mcast-snooping.c +++ b/lib/mcast-snooping.c @@ -432,7 +432,9 @@ mcast_snooping_add_group(struct mcast_snooping *ms, uint32_t hash = mcast_table_hash(ms, addr, vlan); if (hmap_count(&ms->table) >= ms->max_entries) { - group_get_lru(ms, &grp); + if (!group_get_lru(ms, &grp)) { + return false; + } mcast_snooping_flush_group(ms, grp); }
Previously error codes from group_get_lru() were ignored, possibly causing NULL pointer dereferencing. This patch appropriately checks for errors. Fixes: 4a95091d1f66 ("lib: Add IGMP snooping library bits") Signed-off-by: Mike Pattrick <mkp@redhat.com> --- lib/mcast-snooping.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)