linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] airo: remove pointless check
@ 2010-09-10 11:57 Dan Carpenter
  2010-09-10 13:34 ` Stanislaw Gruszka
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2010-09-10 11:57 UTC (permalink / raw)
  To: John W. Linville
  Cc: Matthieu CASTET, Stanislaw Gruszka, linux-wireless,
	kernel-janitors

It doesn't make sense to check "!ai->config.rates" here.
"ai->config.rates" is the address of an eight bytes array and it
can't ever be null here.  Also if it were NULL then trying to set:
	ai->config.rates[i] = basic_rate | 0x80;
would cause an oops.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 1d05445..d806497 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -3886,8 +3886,7 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
 		}
 		if ( basic_rate > 0 ) {
 			for( i = 0; i < 8; i++ ) {
-				if ( ai->config.rates[i] == basic_rate ||
-				     !ai->config.rates ) {
+				if (ai->config.rates[i] == basic_rate) {
 					ai->config.rates[i] = basic_rate | 0x80;
 					break;
 				}

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

end of thread, other threads:[~2010-09-11 23:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-10 11:57 [patch] airo: remove pointless check Dan Carpenter
2010-09-10 13:34 ` Stanislaw Gruszka
2010-09-11 23:48   ` [patch v2] airo: remove "basic_rate" module option Dan Carpenter

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