linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ar9170: wrong test on outlen in ar9170_usb_exec_cmd() ?
@ 2009-04-26 12:40 Roel Kluin
  2009-04-26 19:13 ` Christian Lamparter
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-04-26 12:40 UTC (permalink / raw)
  To: chunkeey; +Cc: linux-wireless

remove redundant test: outlen is unsigned

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Maybe you want to test outlen < MAX, but what should MAX be?

diff --git a/drivers/net/wireless/ar9170/usb.c b/drivers/net/wireless/ar9170/usb.c
index fddda47..dfd39e9 100644
--- a/drivers/net/wireless/ar9170/usb.c
+++ b/drivers/net/wireless/ar9170/usb.c
@@ -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;
 	}

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

* Re: [PATCH] ar9170: wrong test on outlen in ar9170_usb_exec_cmd() ?
  2009-04-26 12:40 [PATCH] ar9170: wrong test on outlen in ar9170_usb_exec_cmd() ? Roel Kluin
@ 2009-04-26 19:13 ` Christian Lamparter
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Lamparter @ 2009-04-26 19:13 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linux-wireless

On Sunday 26 April 2009 14:40:59 Roel Kluin wrote:
> remove redundant test: outlen is unsigned
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Christian Lamparter <chunkeey@web.de>
> ---
> 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

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

end of thread, other threads:[~2009-04-26 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-26 12:40 [PATCH] ar9170: wrong test on outlen in ar9170_usb_exec_cmd() ? Roel Kluin
2009-04-26 19:13 ` Christian Lamparter

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).