linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* potential null deref in minstrel_ht_update_caps()?
@ 2010-07-22 11:09 Dan Carpenter
  2010-07-22 19:35 ` John W. Linville
  2010-07-22 19:39 ` [PATCH] minstrel_ht: remove unnecessary NULL check in minstrel_ht_update_caps John W. Linville
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2010-07-22 11:09 UTC (permalink / raw)
  To: nbd; +Cc: linux-wireless

This is a smatch thing.

net/mac80211/rc80211_minstrel_ht.c +639 minstrel_ht_update_caps(15)
	warn: variable dereferenced before check 'sta'
   631          struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
   632          struct ieee80211_local *local = hw_to_local(mp->hw);
   633          u16 sta_cap = sta->ht_cap.cap;
                              ^^^^^^^^^^^^^^^
	Dereferenced here.

   634          int ack_dur;
   635          int stbc;
   636          int i;
   637
   638          /* fall back to the old minstrel for legacy stations */
   639          if (sta && !sta->ht_cap.ht_supported) {
                    ^^^
	Checked here.

   640                  msp->is_ht = false;
   641                  memset(&msp->legacy, 0, sizeof(msp->legacy));

It seems like a bug, but I'm not sure how to deal with it.

regards,
dan carpenter

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

end of thread, other threads:[~2010-07-22 19:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-22 11:09 potential null deref in minstrel_ht_update_caps()? Dan Carpenter
2010-07-22 19:35 ` John W. Linville
2010-07-22 19:39 ` [PATCH] minstrel_ht: remove unnecessary NULL check in minstrel_ht_update_caps John W. Linville

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