public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Kalle Valo <kalle.valo@nokia.com>
Cc: linux-wireless@vger.kernel.org
Subject: [bug report] wl12xx: add driver
Date: Fri, 6 Feb 2026 11:17:25 +0300	[thread overview]
Message-ID: <aYWjlcQDj4YsoGlt@stanley.mountain> (raw)

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

                 reply	other threads:[~2026-02-06  8:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aYWjlcQDj4YsoGlt@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=kalle.valo@nokia.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox