aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev_addr_lists.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-04 09:16:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-04 09:16:43 +0200
commit8bf7a12c628d1cad59cd8057171dd3ef95f0857a (patch)
tree31bd590f6dfb61e351be19bfcbc636e8b30ecce3 /net/core/dev_addr_lists.c
parentMerge 5.15-rc3 into char-misc next (diff)
parentLinux 5.15-rc4 (diff)
downloadlinux-8bf7a12c628d1cad59cd8057171dd3ef95f0857a.tar.gz
linux-8bf7a12c628d1cad59cd8057171dd3ef95f0857a.zip
Merge 5.15-rc4 into char-misc-next
We need the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/core/dev_addr_lists.c')
-rw-r--r--net/core/dev_addr_lists.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index 8c39283c26ae..f0cb38344126 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -50,6 +50,11 @@ static int __hw_addr_add_ex(struct netdev_hw_addr_list *list,
if (addr_len > MAX_ADDR_LEN)
return -EINVAL;
+ ha = list_first_entry(&list->list, struct netdev_hw_addr, list);
+ if (ha && !memcmp(addr, ha->addr, addr_len) &&
+ (!addr_type || addr_type == ha->type))
+ goto found_it;
+
while (*ins_point) {
int diff;
@@ -64,6 +69,7 @@ static int __hw_addr_add_ex(struct netdev_hw_addr_list *list,
} else if (diff > 0) {
ins_point = &parent->rb_right;
} else {
+found_it:
if (exclusive)
return -EEXIST;
if (global) {