public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] wl12xx: add driver
@ 2026-02-06  8:17 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2026-02-06  8:17 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-06  8:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-06  8:17 [bug report] wl12xx: add driver Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox