From: Dan Carpenter <error27@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: Matthieu CASTET <castet.matthieu@free.fr>,
Stanislaw Gruszka <sgruszka@redhat.com>,
linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] airo: remove pointless check
Date: Fri, 10 Sep 2010 13:57:14 +0200 [thread overview]
Message-ID: <20100910115714.GE5959@bicker> (raw)
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;
}
next reply other threads:[~2010-09-10 11:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 11:57 Dan Carpenter [this message]
2010-09-10 13:34 ` [patch] airo: remove pointless check Stanislaw Gruszka
2010-09-11 23:48 ` [patch v2] airo: remove "basic_rate" module option Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100910115714.GE5959@bicker \
--to=error27@gmail.com \
--cc=castet.matthieu@free.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=sgruszka@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).