wl12xx: add driver
Hello Kalle Valo,
Commit 2f01a1f58889 ("wl12xx: add driver") from Apr 29, 2009 (linux-next), leads to the following Smatch static checker warning:
drivers/net/wireless/ti/wl1251/cmd.c:247 wl1251_cmd_join() index hardmax out of bounds 'bssid[i]' size=4 max='5' rl='0-5'
drivers/net/wireless/ti/wl1251/cmd.c
229 int wl1251_cmd_join(struct wl1251 *wl, u8 bss_type, u8 channel,
230 u16 beacon_interval, u8 dtim_interval)
231 {
232 struct cmd_join *join;
233 int ret, i;
234 u8 *bssid;
235
236 join = kzalloc(sizeof(*join), GFP_KERNEL);
237 if (!join)
238 return -ENOMEM;
239
240 wl1251_debug(DEBUG_CMD, "cmd join%s ch %d %d/%d",
241 bss_type == BSS_TYPE_IBSS ? " ibss" : "",
242 channel, beacon_interval, dtim_interval);
243
244 /* Reverse order BSSID */
245 bssid = (u8 *) &join->bssid_lsb;
246 for (i = 0; i < ETH_ALEN; i++)--> 247 bssid[i] = wl->bssid[ETH_ALEN - i - 1];
This is fine, but it should use a struct_group() or the KSan stuff will complain.
248
249 join->rx_config_options = wl->rx_config;
250 join->rx_filter_options = wl->rx_filter;
251
252 join->basic_rate_set = RATE_MASK_1MBPS | RATE_MASK_2MBPS |
253 RATE_MASK_5_5MBPS | RATE_MASK_11MBPS;regards,
dan carpenter