Skip to contentSkip to conversation

staging: rtl8712: fix wrong function output

PATCH Superseded Sergei Krainov 2 participants 4 messages Apr 8, 2021 – Apr 9, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/staging/rtl8712/rtl871x_mlme.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/rtl8712/rtl871x_mlme.c +2 -0
index 8a97307fbbd6..c38161114b80 100644
@@ -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;
 }
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 8 lines · Sergei Krainov

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.

---
 drivers/staging/rtl8712/rtl871x_mlme.c | 2 ++
 1 file changed, 2 insertions(+)

What commit does this "fix"? Or has this bug been there always?

thanks,

greg k-h

#2 lore raw
Quoted 10 lines · Greg KH
Quoted 8 lines · Sergei Krainov

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.

---
 drivers/staging/rtl8712/rtl871x_mlme.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 5 lines

What commit does this "fix"? Or has this bug been there always?

thanks,

greg k-h

This commit fixes the bug mentioned.

And this commit is based on staging-next and has nothing to do with my previous patches, for which I'm sorry, I was wrong.

Thanks a lot for review and your time,

Sergei

maintainer
#3 lore raw
Quoted 11 lines · Sergei Krainov
Quoted 10 lines · Greg KH
Quoted 8 lines · Sergei Krainov

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.

---
 drivers/staging/rtl8712/rtl871x_mlme.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 7 lines
Quoted 5 lines

What commit does this "fix"? Or has this bug been there always?

thanks,

greg k-h

This commit fixes the bug mentioned.

What bug mentioned?

Quoted 2 lines

And this commit is based on staging-next and has nothing to do with my previous patches, for which I'm sorry, I was wrong.

I do not understand at all, sorry.

Please resend with a "Fixes:" tag that shows the commit that this fixes.

thanks,

greg k-h