linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 15:37:56 +0300	[thread overview]
Message-ID: <20151126123756.GF7289@mwanda> (raw)
In-Reply-To: <1448540211.2167.7.camel@sipsolutions.net>

On Thu, Nov 26, 2015 at 01:16:51PM +0100, Johannes Berg wrote:
> On Thu, 2015-11-26 at 15:03 +0300, Dan Carpenter wrote:
> > 
> >   2793          if (lq_sta && !lq_sta->pers.drv) {
> >                     ^^^^^^
> > Check.
> > 
> >   2794                  IWL_DEBUG_RATE(mvm, "Rate scaling not
> > initialized yet.\n");
> >   2795                  mvm_sta = NULL;
> >   2796          }
> >   2797  
> >   2798          /* Send management frames and NO_ACK data using
> > lowest rate. */
> >   2799          if (rate_control_send_low(sta, mvm_sta, txrc))
> >   2800                  return;
> >   2801  
> >   2802          iwl_mvm_hwrate_to_tx_rate(lq_sta->last_rate_n_flags,
> >                                           ^^^^^^^^^^^^^^^^^^^^^^^^^
> > Uchecked dereference.
> > 
> 
> Yeah, this is a bit tricky. If you look into rate_control_send_low(),
> I'm sure it'll return true when mvm_sta argument is NULL. Not sure how,
> if at all, we could make that more explicit here.

Ah.  Thanks for looking at this.  Eventually Smatch will be smart enough
to figure this implication out but not yet.  No need to change the code
because the static checker isn't capable enough...

regards,
dan carpenter


  reply	other threads:[~2015-11-26 12:38 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 [this message]
2015-11-26 12:51     ` Johannes Berg
2015-11-26 19:44       ` Dan Carpenter
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=20151126123756.GF7289@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 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).