[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210408234527.GA6893@test-VirtualBox>
Date: Fri, 9 Apr 2021 01:45:27 +0200
From: Sergei Krainov <sergei.krainov.lkd@...il.com>
To: Larry.Finger@...inger.net, florian.c.schilhabel@...glemail.com,
gregkh@...uxfoundation.org
Cc: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH] staging: rtl8712: fix wrong function output
Function r8712_find_network() were returning wlan_network even if it
didn't match required address. This happened due to not checking if
list end was reached and returning last processed wlan_network.
Signed-off-by: Sergei Krainov <sergei.krainov.lkd@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c
index 8a97307fbbd6..c38161114b80 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.c
+++ b/drivers/staging/rtl8712/rtl871x_mlme.c
@@ -146,6 +146,8 @@ static struct wlan_network *r8712_find_network(struct __queue *scanned_queue,
if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN))
break;
}
+ if (plist == phead)
+ pnetwork = NULL;
spin_unlock_irqrestore(&scanned_queue->lock, irqL);
return pnetwork;
}
--
2.25.1
Powered by blists - more mailing lists