Linux wireless drivers development
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: linux-wireless@vger.kernel.org
Subject: potential null dereference in ipw_wx_set_scan()
Date: Tue, 3 Feb 2009 11:21:52 +0300 (EAT)	[thread overview]
Message-ID: <alpine.DEB.2.00.0902012132350.2949@bikeee> (raw)

I'm testing out my code checker (http://repo.or.cz/w/smatch.git/).

It complains about ipw_wx_set_scan() from 
drivers/net/wireless/ipw2x00/ipw2200.c

Can the "if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { " from line 9522 
ever be false?  If the conditions on lines 9516 and 9522 were both false 
then 'work' would still be NULL.  That causes a null dereference in 
queue_delayed_work() on line 9534.

   9515          if (wrqu->data.length == sizeof(struct iw_scan_req)) {
   9516                  if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
   9517                          int len = min((int)req->essid_len,
   9518                                        (int)sizeof(priv->direct_scan_ssid));
   9519                          memcpy(priv->direct_scan_ssid, req->essid, len);
   9520                          priv->direct_scan_ssid_len = len;
   9521                          work = &priv->request_direct_scan;
   9522                  } else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) {
   9523                          work = &priv->request_passive_scan;
   9524                  }
   9525          } else {
   9526                  /* Normal active broadcast scan */
   9527                  work = &priv->request_scan;
   9528          }

regards,
dan carpenter


             reply	other threads:[~2009-02-03  8:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03  8:21 Dan Carpenter [this message]
2009-02-03  9:18 ` potential null dereference in ipw_wx_set_scan() Zhu Yi

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=alpine.DEB.2.00.0902012132350.2949@bikeee \
    --to=error27@gmail.com \
    --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