Skip to contentSkip to conversation

ar9170: wrong test on outlen in ar9170_usb_exec_cmd() ?

PATCH In review Roel Kluin 2 participants 2 messages Apr 26, 2009 Networking drivers (wireless)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 ar9170: wrong test on outlen in ar9170_usb_exec_cmd() ?

remove redundant test: outlen is unsigned

---
Maybe you want to test outlen < MAX, but what should MAX be?

drivers/net/wireless/ar9170/usb.c +1 -1
index fddda47..dfd39e9 100644
@@ -350,7 +350,7 @@ static int ar9170_usb_exec_cmd(struct ar9170 *ar, enum ar9170_cmd cmd,
 		goto err_unbuf;
 	}
 
-	if (outlen >= 0 && aru->readlen != outlen) {
+	if (aru->readlen != outlen) {
 		err = -EMSGSIZE;
 		goto err_unbuf;
 	}
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · On Sunday 26 April 2009 14:40:59 Roel Kluin wrote:

remove redundant test: outlen is unsigned

Quoted 2 lines

---
Maybe you want to test outlen < MAX, but what should MAX be?

Not necessary, there is no hard limit for the size of cmd response. The firmware will scatter the cmd responses into ~64 bytes packages, if needed.

Regards,
Chr