[staging:staging-testing 59/59] drivers/staging/wfx/sta.c:244:1-7: alloc with no test, possible model on line 260

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing
head:   40115bbc40e2fd2de0e01ef2a28e0d09a1b5d0d1
commit: 40115bbc40e2fd2de0e01ef2a28e0d09a1b5d0d1 [59/59] staging: wfx: implement the rest of mac80211 API

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


coccinelle warnings: (new ones prefixed by >>)

>> drivers/staging/wfx/sta.c:244:1-7: alloc with no test, possible model on line 260

vim +244 drivers/staging/wfx/sta.c

   212	
   213	void wfx_update_filtering(struct wfx_vif *wvif)
   214	{
   215		int ret;
   216		bool is_sta = wvif->vif && NL80211_IFTYPE_STATION == wvif->vif->type;
   217		bool filter_bssid = wvif->filter_bssid;
   218		bool fwd_probe_req = wvif->fwd_probe_req;
   219		struct hif_mib_bcn_filter_enable bf_ctrl;
   220		struct hif_mib_bcn_filter_table *bf_tbl;
   221		struct hif_ie_table_entry ie_tbl[] = {
   222			{
   223				.ie_id        = WLAN_EID_VENDOR_SPECIFIC,
   224				.has_changed  = 1,
   225				.no_longer    = 1,
   226				.has_appeared = 1,
   227				.oui         = { 0x50, 0x6F, 0x9A},
   228			}, {
   229				.ie_id        = WLAN_EID_HT_OPERATION,
   230				.has_changed  = 1,
   231				.no_longer    = 1,
   232				.has_appeared = 1,
   233			}, {
   234				.ie_id        = WLAN_EID_ERP_INFO,
   235				.has_changed  = 1,
   236				.no_longer    = 1,
   237				.has_appeared = 1,
   238			}
   239		};
   240	
   241		if (wvif->state == WFX_STATE_PASSIVE)
   242			return;
   243	
 > 244		bf_tbl = kmalloc(sizeof(struct hif_mib_bcn_filter_table) + sizeof(ie_tbl), GFP_KERNEL);
   245		memcpy(bf_tbl->ie_table, ie_tbl, sizeof(ie_tbl));
   246		if (wvif->disable_beacon_filter) {
   247			bf_ctrl.enable = 0;
   248			bf_ctrl.bcn_count = 1;
   249			bf_tbl->num_of_info_elmts = 0;
   250		} else if (!is_sta) {
   251			bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE | HIF_BEACON_FILTER_AUTO_ERP;
   252			bf_ctrl.bcn_count = 0;
   253			bf_tbl->num_of_info_elmts = 2;
   254		} else {
   255			bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE;
   256			bf_ctrl.bcn_count = 0;
   257			bf_tbl->num_of_info_elmts = 3;
   258		}
   259	
 > 260		ret = hif_set_rx_filter(wvif, filter_bssid, fwd_probe_req);
   261		if (!ret)
   262			ret = hif_set_beacon_filter_table(wvif, bf_tbl);
   263		if (!ret)
   264			ret = hif_beacon_filter_control(wvif, bf_ctrl.enable, bf_ctrl.bcn_count);
   265		if (!ret)
   266			ret = wfx_set_mcast_filter(wvif, &wvif->mcast_filter);
   267		if (ret)
   268			dev_err(wvif->wdev->dev, "update filtering failed: %d\n", ret);
   269		kfree(bf_tbl);
   270	}
   271	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux