linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: "Dan Carpenter" <dan.carpenter@oracle.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: net: wireless: add brcm80211 drivers
Date: Mon, 14 May 2012 09:07:55 +0200	[thread overview]
Message-ID: <4FB0AF4B.9070606@broadcom.com> (raw)
In-Reply-To: <20120513174333.GB4280@elgon.mountain>

On 05/13/2012 07:43 PM, Dan Carpenter wrote:
> Hi Arend,
> 
> This code is not really new, but I thought I would email you anyway
> because I know you are responsive.  :)

Dito ;-)

> The patch 5b435de0d786: "net: wireless: add brcm80211 drivers" from 
> Oct 5, 2011, leads to the following Smatch complaint:
> 
> drivers/net/wireless/brcm80211/brcmsmac/ampdu.c:741 brcms_c_sendampdu()
> 	 warn: variable dereferenced before check 'p' (see line 739)
> 
> drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
>    733                  /*
>    734                   * check to see if the next pkt is
>    735                   * a candidate for aggregation
>    736                   */
>    737                  p = pktq_ppeek(&qi->q, prec);
>    738			/* tx_info must be checked with current p */
>    739			tx_info = IEEE80211_SKB_CB(p);
>                                   ^^^^^^^^^^^^^^^^
> "p" is dereferenced inside the call to IEEE80211_SKB_CB().
> 
>    740	
>    741			if (p) {
>                            ^^^
> Checked too late.
> 
>    742				if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) &&
>    743				    ((u8) (p->priority) == tid)) {
> 
> regards,
> dan carpenter
> 
> 

Thanks for running smatch. I will look in the current code base and fix
this. Just out of curiosity: Another static checker used regularly is
Coccinelle. What are the pros and cons of smatch compared to Coccinelle?

Gr. AvS


  reply	other threads:[~2012-05-14  7:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-13 17:43 net: wireless: add brcm80211 drivers Dan Carpenter
2012-05-14  7:07 ` Arend van Spriel [this message]
2012-05-14  8:34   ` Dan Carpenter
2012-05-14  9:06     ` Arend van Spriel
2012-05-14  9:28       ` Dan Carpenter
2012-05-14 11:45     ` Julia Lawall
  -- strict thread matches above, loose matches on Subject: below --
2012-08-05 19:57 Dan Carpenter
2012-08-06  8:50 ` Arend van Spriel
2016-06-27 13:22 Dan Carpenter
2016-06-27 19:12 ` 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=4FB0AF4B.9070606@broadcom.com \
    --to=arend@broadcom.com \
    --cc=dan.carpenter@oracle.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;
as well as URLs for NNTP newsgroup(s).