Skip to contentSkip to conversation

brcm80211: make mgmt_tx in brcmfmac accept a NULL channel

DISCUSSION Dan Carpenter 2 participants 2 messages Jun 19, 2013

lore
Share & tools
lore
#0 lore raw

Hello Antonio Quartulli,

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

The patch c2ff8cad6423: "brcm80211: make mgmt_tx in brcmfmac accept a NULL channel" from Jun 11, 2013, leads to the following Smatch complaint:

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c:4052 brcmf_cfg80211_mgmt_tx()
error: we previously assumed 'chan' could be null (see line 4041)

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
4040 */
4041 if (chan)

                            ^^^^

New check reflects that "chan" can now be NULL.

4042 freq = chan->center_freq;
4043 else
4044 brcmf_fil_cmd_int_get(vif->ifp, BRCMF_C_GET_CHANNEL,
4045 &freq);
4046 chan_nr = ieee80211_frequency_to_channel(freq);
4047 af_params->channel = cpu_to_le32(chan_nr);
4048
4049 memcpy(action_frame->data, &buf[DOT11_MGMT_HDR_LEN],
4050 le16_to_cpu(action_frame->len));
4051
4052 brcmf_dbg(TRACE, "Action frame, cookie=%lld, len=%d, freq=%d\n",
4053 *cookie, le16_to_cpu(action_frame->len),

  4054				  chan->center_freq);
                                  ^^^^^^

This needs to be updated as well.

regards,
dan carpenter

#1 lore raw

Hello Dan,

Quoted 29 lines · Dan Carpenter

Hello Antonio Quartulli,

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

The patch c2ff8cad6423: "brcm80211: make mgmt_tx in brcmfmac accept a NULL channel" from Jun 11, 2013, leads to the following Smatch complaint:

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c:4052 brcmf_cfg80211_mgmt_tx()
error: we previously assumed 'chan' could be null (see line 4041)

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
4040 */
4041 if (chan)

                            ^^^^

New check reflects that "chan" can now be NULL.

4042 freq = chan->center_freq;
4043 else
4044 brcmf_fil_cmd_int_get(vif->ifp, BRCMF_C_GET_CHANNEL,
4045 &freq);
4046 chan_nr = ieee80211_frequency_to_channel(freq);
4047 af_params->channel = cpu_to_le32(chan_nr);
4048
4049 memcpy(action_frame->data, &buf[DOT11_MGMT_HDR_LEN],
4050 le16_to_cpu(action_frame->len));
4051
4052 brcmf_dbg(TRACE, "Action frame, cookie=%lld, len=%d, freq=%d\n",
4053 *cookie, le16_to_cpu(action_frame->len),

Quoted 4 lines
  4054				  chan->center_freq);
                                  ^^^^^^

This needs to be updated as well.

Thank you very much for spotting this. I'm going to send a patch fixing it. (however the line numbers were shifted..)

Regards,

Signature · 4 lines
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara