All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] ath10k: add support for configuring management packet rate
@ 2018-10-10 11:00 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2018-10-10 11:00 UTC (permalink / raw)
  To: srirrama; +Cc: ath10k

Hello Sriram R,

The patch f279294e9ee2: "ath10k: add support for configuring
management packet rate" from Sep 10, 2018, leads to the following
static checker warning:

	drivers/net/wireless/ath/ath10k/mac.c:5685 ath10k_bss_info_changed()
	warn: inconsistent indenting

drivers/net/wireless/ath/ath10k/mac.c
  5673                  if (ret)
  5674                          ath10k_warn(ar,
  5675                                      "failed to set bcast rate on vdev %i: %d\n",
  5676                                      arvif->vdev_id,  ret);
  5677          }
  5678  
  5679          if (changed & BSS_CHANGED_BASIC_RATES) {
                                                       ^
Start

  5680                  if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) {
  5681                          mutex_unlock(&ar->conf_mutex);
  5682                          return;
  5683                  }
  5684  
  5685          sband = ar->hw->wiphy->bands[def.chan->band];
  5686          basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
  5687          bitrate = sband->bitrates[basic_rate_idx].bitrate;
  5688  
  5689          hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
  5690          if (hw_rate_code < 0) {
  5691                  ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
  5692                  mutex_unlock(&ar->conf_mutex);
  5693                  return;
  5694          }
  5695  
  5696          vdev_param = ar->wmi.vdev_param->mgmt_rate;
  5697          ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
  5698                                          hw_rate_code);
  5699          if (ret)
  5700                  ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
  5701          }
                ^
End.  Looks like a bug.

  5702  
  5703          mutex_unlock(&ar->conf_mutex);
  5704  }

regards,
dan carpenter

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [bug report] ath10k: add support for configuring management packet rate
@ 2018-10-10 10:49 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2018-10-10 10:49 UTC (permalink / raw)
  To: srirrama; +Cc: ath10k

Hello Sriram R,

The patch f279294e9ee2: "ath10k: add support for configuring
management packet rate" from Sep 10, 2018, leads to the following
static checker warning:

	drivers/net/wireless/ath/ath10k/mac.c:168 ath10k_mac_get_rate_hw_value()
	error: buffer overflow 'ath10k_rates' 12 <= 143

drivers/net/wireless/ath/ath10k/mac.c
   159  static int ath10k_mac_get_rate_hw_value(int bitrate)
   160  {
   161          int i;
   162          u8 hw_value_prefix = 0;
   163  
   164          if (ath10k_mac_bitrate_is_cck(bitrate))
   165                  hw_value_prefix = WMI_RATE_PREAMBLE_CCK << 6;
   166  
   167          for (i = 0; i < sizeof(ath10k_rates); i++) {
                                ^^^^^^^^^^^^^^^^^^^^
Should be ARRAY_SIZE() instead of sizeof().

   168                  if (ath10k_rates[i].bitrate == bitrate)
   169                          return hw_value_prefix | ath10k_rates[i].hw_value;
   170          }
   171  
   172          return -EINVAL;
   173  }
   174  

regards,
dan carpenter

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

end of thread, other threads:[~2018-10-10 11:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-10 11:00 [bug report] ath10k: add support for configuring management packet rate Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2018-10-10 10:49 Dan Carpenter

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.