Message ID | 20240909045505.236657-8-mkp@redhat.com |
---|---|
State | Accepted, archived |
Commit | 363435fe8c5ca4410feb6b1ae8e56479a758f2fd |
Delegated to: | Eelco Chaudron |
Headers | show |
Series | Address clang analyze warnings. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
On 9 Sep 2024, at 6:55, 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") > Acked-by: Eelco Chaudron <echaudro@redhat.com> > Signed-off-by: Mike Pattrick <mkp@redhat.com> Thanks for sending out the v3, the changes look good to me. Cheers, Eelco Acked-by: Eelco Chaudron <echaudro@redhat.com>
On Mon, Sep 09, 2024 at 12:55:04AM -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") > Acked-by: Eelco Chaudron <echaudro@redhat.com> > 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); }