linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mt76: mt7615: fix wrong length in strncmp
@ 2020-02-05  3:46 Ryder Lee
  2020-02-05  8:19 ` Felix Fietkau
  0 siblings, 1 reply; 2+ messages in thread
From: Ryder Lee @ 2020-02-05  3:46 UTC (permalink / raw)
  To: Felix Fietkau, Lorenzo Bianconi
  Cc: Ryder Lee, Josh Boyer, Sean Wang, linux-wireless, linux-mediatek,
	Shayne Chen

Fix it to proper length.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index 6639f9291721..fbda56342d11 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -491,7 +491,7 @@ static int mt7615_load_ram(struct mt7615_dev *dev)
 		goto out;
 	}
 
-	if (!strncmp(hdr->fw_ver, "2.0", 6))
+	if (!strncmp(hdr->fw_ver, "2.0", 3))
 		dev->fw_ver = MT7615_FIRMWARE_V2;
 	else
 		dev->fw_ver = MT7615_FIRMWARE_V1;
-- 
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mt76: mt7615: fix wrong length in strncmp
  2020-02-05  3:46 [PATCH] mt76: mt7615: fix wrong length in strncmp Ryder Lee
@ 2020-02-05  8:19 ` Felix Fietkau
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Fietkau @ 2020-02-05  8:19 UTC (permalink / raw)
  To: Ryder Lee, Lorenzo Bianconi
  Cc: Josh Boyer, Sean Wang, linux-wireless, linux-mediatek, Shayne Chen

On 2020-02-05 04:46, Ryder Lee wrote:
> Fix it to proper length.
> 
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> index 6639f9291721..fbda56342d11 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> @@ -491,7 +491,7 @@ static int mt7615_load_ram(struct mt7615_dev *dev)
>  		goto out;
>  	}
>  
> -	if (!strncmp(hdr->fw_ver, "2.0", 6))
> +	if (!strncmp(hdr->fw_ver, "2.0", 3))
Do you plan on allowing more characters after the 2.0 and still match?
If not, maybe we should just use sizeof(hdr->fw_ver) as max len.

- Felix

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-05  8:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05  3:46 [PATCH] mt76: mt7615: fix wrong length in strncmp Ryder Lee
2020-02-05  8:19 ` Felix Fietkau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).