2012-04-16 10:55:32

by Dan Carpenter

[permalink] [raw]
Subject: re: wlcore/wl12xx: change GEM Tx-spare blocks per-vif

Hello Arik Nemtsov,

This is a semi-automatic email about new static checker warnings.

The patch 3edab305dfd4: "wlcore/wl12xx: change GEM Tx-spare blocks
per-vif" from Dec 7, 2011, leads to the following Smatch complaint:

drivers/net/wireless/ti/wlcore/tx.c:231 wl1271_tx_allocate()
warn: variable dereferenced before check 'wlvif' (see line 208)

drivers/net/wireless/ti/wlcore/tx.c
207 else if (wlvif->is_gem)
^^^^^^^^^^^^^
New dereference.

208 spare_blocks = wl->gem_tx_spare;
209
210 total_blocks = wlcore_hw_calc_tx_blocks(wl, total_len, spare_blocks);
211
212 if (total_blocks <= wl->tx_blocks_available) {
213 desc = (struct wl1271_tx_hw_descr *)skb_push(
214 skb, total_len - skb->len);
215
216 wlcore_hw_set_tx_desc_blocks(wl, desc, total_blocks,
217 spare_blocks);
218
219 desc->id = id;
220
221 wl->tx_blocks_available -= total_blocks;
222 wl->tx_allocated_blocks += total_blocks;
223
224 /* If the FW was empty before, arm the Tx watchdog */
225 if (wl->tx_allocated_blocks == total_blocks)
226 wl12xx_rearm_tx_watchdog_locked(wl);
227
228 ac = wl1271_tx_get_queue(skb_get_queue_mapping(skb));
229 wl->tx_allocated_pkts[ac]++;
230
231 if (!is_dummy && wlvif &&
^^^^^
Old check.

232 wlvif->bss_type == BSS_TYPE_AP_BSS &&
233 test_bit(hlid, wlvif->ap.sta_hlid_map))

regards,
dan carpenter



2012-04-16 19:03:44

by Arik Nemtsov

[permalink] [raw]
Subject: Re: wlcore/wl12xx: change GEM Tx-spare blocks per-vif

On Mon, Apr 16, 2012 at 13:55, Dan Carpenter <[email protected]> wrote:
> Hello Arik Nemtsov,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch 3edab305dfd4: "wlcore/wl12xx: change GEM Tx-spare blocks
> per-vif" from Dec 7, 2011, leads to the following Smatch complaint:
>
> drivers/net/wireless/ti/wlcore/tx.c:231 wl1271_tx_allocate()
> ? ? ? ? warn: variable dereferenced before check 'wlvif' (see line 208)

Thanks Dan. We'll fix it shortly.

Arik