From: Dan Carpenter <dan.carpenter@oracle.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: (bug report) iwlwifi: inconsitent NULL checking
Date: Thu, 26 Nov 2015 22:44:51 +0300 [thread overview]
Message-ID: <20151126194451.GH7289@mwanda> (raw)
In-Reply-To: <1448542297.2167.10.camel@sipsolutions.net>
There are two issues in Smatch that would need to be fixed:
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
index d1ad103..d3bc193 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
@@ -2767,6 +2767,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm,
iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, init);
}
+#include "/home/dcarpenter/progs/smatch/devel/check_debug.h"
static void rs_get_rate(void *mvm_r, struct ieee80211_sta *sta, void *mvm_sta,
struct ieee80211_tx_rate_control *txrc)
{
@@ -2795,9 +2796,13 @@ static void rs_get_rate(void *mvm_r, struct ieee80211_sta *sta, void *mvm_sta,
mvm_sta = NULL;
}
+ if (mvm_sta)
+ __smatch_implied(lq_sta);
+
/* Send management frames and NO_ACK data using lowest rate. */
if (rate_control_send_low(sta, mvm_sta, txrc))
return;
+ __smatch_implied(mvm_sta);
iwl_mvm_hwrate_to_tx_rate(lq_sta->last_rate_n_flags,
info->band, &info->control.rates[0]);
If apply that patch (with changes for your system) and run
kchecker drivers/net/wireless/intel/iwlwifi/mvm/rs.c then it prints:
drivers/net/wireless/intel/iwlwifi/mvm/rs.c:2800 rs_get_rate() implied: lq_sta = '0,4096-2117777777777777777'
drivers/net/wireless/intel/iwlwifi/mvm/rs.c:2805 rs_get_rate() implied: mvm_sta = 's64min-(-1),1-s64max'
The first problem is that it doesn't see that if mvm_sta is non-NULL
then that implies lq_sta is non-NULL. But even if that worked, after we
do the function call, it sees that the function that mvm_sta is non-NULL
but it wouldn't see that that means lq_sta is non-NULL. It's not so
terribly far from working but it's not there yet.
regards,
dan carpenter
next prev parent reply other threads:[~2015-11-26 19:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-26 12:03 (bug report) iwlwifi: inconsitent NULL checking Dan Carpenter
2015-11-26 12:16 ` Johannes Berg
2015-11-26 12:37 ` Dan Carpenter
2015-11-26 12:51 ` Johannes Berg
2015-11-26 19:44 ` Dan Carpenter [this message]
2015-11-26 20:21 ` Johannes Berg
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=20151126194451.GH7289@mwanda \
--to=dan.carpenter@oracle.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.