drivers/net/wireless/ath/ath11k/mac.c:1892:7: warning: Uninitialized variable: ret

From: kernel test robot
Date: Mon Mar 01 2021 - 15:14:11 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8
commit: 047679e366b9842a9da3ab82dca26fcaad8020eb ath11k: FILS discovery and unsolicited broadcast probe response support
date: 4 months ago
compiler: or1k-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


"cppcheck warnings: (new ones prefixed by >>)"
>> drivers/net/wireless/ath/ath11k/mac.c:1892:7: warning: Uninitialized variable: ret [uninitvar]
if (!ret)
^

vim +1892 drivers/net/wireless/ath/ath11k/mac.c

1852
1853 static int ath11k_mac_fils_discovery(struct ath11k_vif *arvif,
1854 struct ieee80211_bss_conf *info)
1855 {
1856 struct ath11k *ar = arvif->ar;
1857 struct sk_buff *tmpl;
1858 int ret;
1859 u32 interval;
1860 bool unsol_bcast_probe_resp_enabled = false;
1861
1862 if (info->fils_discovery.max_interval) {
1863 interval = info->fils_discovery.max_interval;
1864
1865 tmpl = ieee80211_get_fils_discovery_tmpl(ar->hw, arvif->vif);
1866 if (tmpl)
1867 ret = ath11k_wmi_fils_discovery_tmpl(ar, arvif->vdev_id,
1868 tmpl);
1869 } else if (info->unsol_bcast_probe_resp_interval) {
1870 unsol_bcast_probe_resp_enabled = 1;
1871 interval = info->unsol_bcast_probe_resp_interval;
1872
1873 tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl(ar->hw,
1874 arvif->vif);
1875 if (tmpl)
1876 ret = ath11k_wmi_probe_resp_tmpl(ar, arvif->vdev_id,
1877 tmpl);
1878 } else { /* Disable */
1879 return ath11k_wmi_fils_discovery(ar, arvif->vdev_id, 0, false);
1880 }
1881
1882 if (!tmpl) {
1883 ath11k_warn(ar->ab,
1884 "mac vdev %i failed to retrieve %s template\n",
1885 arvif->vdev_id, (unsol_bcast_probe_resp_enabled ?
1886 "unsolicited broadcast probe response" :
1887 "FILS discovery"));
1888 return -EPERM;
1889 }
1890 kfree_skb(tmpl);
1891
> 1892 if (!ret)
1893 ret = ath11k_wmi_fils_discovery(ar, arvif->vdev_id, interval,
1894 unsol_bcast_probe_resp_enabled);
1895
1896 return ret;
1897 }
1898

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx