All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: fariyaf@gmail.com
Cc: linux-wireless@vger.kernel.org
Subject: re: rsi: Add RS9113 wireless driver
Date: Fri, 28 Mar 2014 11:28:11 +0300	[thread overview]
Message-ID: <20140328082811.GL25192@mwanda> (raw)

Hello Fariya Fatima,

The patch dad0d04fa7ba: "rsi: Add RS9113 wireless driver" from Mar
16, 2014, leads to the following static checker warning:

	drivers/net/wireless/rsi/rsi_91x_core.c:121 rsi_core_determine_hal_queue()
	error: buffer overflow 'common->tx_qinfo' 4 <= 4

This is probably a false positive.

drivers/net/wireless/rsi/rsi_91x_core.c
   104  get_queue_num:
   105          q_num = 0;
                ^^^^^^^^^
Unneeded assignment.

   106          recontend_queue = false;
   107  
   108          q_num = rsi_determine_min_weight_queue(common);
                ^^^^^
q_num = 0-4.

   109          q_len = skb_queue_len(&common->tx_queue[ii]);
   110          ii = q_num;
   111  
   112          /* Selecting the queue with least back off */
   113          for (; ii < NUM_EDCA_QUEUES; ii++) {
   114                  if (((common->tx_qinfo[ii].pkt_contended) &&
   115                       (common->tx_qinfo[ii].weight < min)) && q_len) {
   116                          min = common->tx_qinfo[ii].weight;
   117                          q_num = ii;
   118                  }
   119          }
   120  
   121          common->tx_qinfo[q_num].pkt_contended = 0;
                                 ^^^^^
4 is too high.

   122          /* Adjust the back off values for all queues again */
   123          recontend_queue = rsi_recalculate_weights(common);

regards,
dan carpenter

             reply	other threads:[~2014-03-28  8:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28  8:28 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-03-27 15:05 rsi: Add RS9113 wireless driver Dan Carpenter
2014-03-27 15:05 ` 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=20140328082811.GL25192@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=fariyaf@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 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.