The following issues were found
drivers/net/wireless/ath/ath5k/pcu.c
2 issues
Line: 378
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
u32 pcu_reg;
/* Set new station ID */
memcpy(common->macaddr, mac, ETH_ALEN);
pcu_reg = ath5k_hw_reg_read(ah, AR5K_STA_ID1) & 0xffff0000;
low_id = get_unaligned_le32(mac);
high_id = get_unaligned_le16(mac + 4);
Reported by FlawFinder.
Line: 454
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* Cache bssid mask so that we can restore it
* on reset */
memcpy(common->bssidmask, mask, ETH_ALEN);
if (ah->ah_version == AR5K_AR5212)
ath_hw_setbssidmask(common);
}
/**
Reported by FlawFinder.
drivers/net/wireless/ath/ath5k/trace.h
2 issues
Line: 32
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
TP_fast_assign(
__entry->priv = priv;
__entry->skbaddr = (unsigned long) skb;
memcpy(__get_dynamic_array(frame), skb->data, skb->len);
),
TP_printk(
"[%p] RX skb=%lx", __entry->priv, __entry->skbaddr
)
);
Reported by FlawFinder.
Line: 56
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
__entry->priv = priv;
__entry->skbaddr = (unsigned long) skb;
__entry->qnum = (u8) q->qnum;
memcpy(__get_dynamic_array(frame), skb->data, skb->len);
),
TP_printk(
"[%p] TX skb=%lx q=%d", __entry->priv, __entry->skbaddr,
__entry->qnum
Reported by FlawFinder.
drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c
2 issues
Line: 254
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* The data in the HW should be in Big Endian Format */
cell->desc = cpu_to_be64(cell->desc);
memcpy(cell_ctxt->api_cmd_vaddr, cmd, cmd_size);
}
/**
* prepare_cell - prepare cell ctrl and cmd in the current cell
* @chain: chain for the command
Reported by FlawFinder.
Line: 683
Column: 8
CWE codes:
120
20
if (!node)
return -ENOMEM;
node->read.hw_wb_resp_paddr = 0;
cell_ctxt = &chain->cell_ctxt[cell_idx];
cell_ctxt->cell_vaddr = node;
cell_ctxt->cell_paddr = node_paddr;
Reported by FlawFinder.
drivers/net/wireless/ath/ath6kl/sdio.c
2 issues
Line: 427
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
tbuf = ar_sdio->dma_buffer;
if (request & HIF_WRITE)
memcpy(tbuf, buf, len);
bounced = true;
} else {
tbuf = buf;
}
Reported by FlawFinder.
Line: 436
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
ret = ath6kl_sdio_io(ar_sdio->func, request, addr, tbuf, len);
if ((request & HIF_READ) && bounced)
memcpy(buf, tbuf, len);
if (bounced)
mutex_unlock(&ar_sdio->dma_buffer_mutex);
return ret;
Reported by FlawFinder.
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_trace.h
2 issues
Line: 35
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
__entry->code = req->msg.code;
__assign_str(pciname, pci_name(hdev->pdev));
__assign_str(devname, &hdev->nic.kinfo.netdev->name);
memcpy(__entry->mbx_data, req,
sizeof(struct hclge_mbx_pf_to_vf_cmd));
),
TP_printk(
"%s %s vfid:%u code:%u data:%s",
Reported by FlawFinder.
Line: 68
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
__entry->subcode = req->msg.subcode;
__assign_str(pciname, pci_name(hdev->pdev));
__assign_str(devname, &hdev->nic.kinfo.netdev->name);
memcpy(__entry->mbx_data, req,
sizeof(struct hclge_mbx_vf_to_pf_cmd));
),
TP_printk(
"%s %s vfid:%u code:%u subcode:%u data:%s",
Reported by FlawFinder.
drivers/net/wireless/ath/ath6kl/txrx.c
2 issues
Line: 76
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return ENDPOINT_UNUSED;
}
memcpy(ar->node_map[ep_map].mac_addr, eth_hdr->h_dest, ETH_ALEN);
for (i = ENDPOINT_2; i <= ENDPOINT_5; i++) {
if (!ar->tx_pending[i]) {
ar->node_map[ep_map].ep_id = i;
break;
Reported by FlawFinder.
Line: 1020
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
break;
}
memcpy(new_skb->data, framep, frame_8023_len);
skb_put(new_skb, frame_8023_len);
if (ath6kl_wmi_dot3_2_dix(new_skb)) {
ath6kl_err("dot3_2_dix error\n");
dev_kfree_skb(new_skb);
break;
Reported by FlawFinder.
drivers/net/wireless/ath/ath9k/channel.c
2 issues
Line: 579
CWE codes:
476
if (sc->sched.state != ATH_CHANCTX_STATE_WAIT_FOR_BEACON)
break;
ath_dbg(common, CHAN_CTX, "Preparing beacon for vif: %pM\n", vif->addr);
sc->sched.beacon_pending = true;
sc->sched.next_tbtt = REG_READ(ah, AR_NEXT_TBTT_TIMER);
cur_conf = &sc->cur_chan->beacon;
Reported by Cppcheck.
Line: 138
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
spin_lock_bh(&sc->chan_lock);
if (chandef)
memcpy(&ctx->chandef, chandef, sizeof(*chandef));
cur_chan = sc->cur_chan == ctx;
spin_unlock_bh(&sc->chan_lock);
if (!cur_chan) {
ath_dbg(common, CHAN_CTX,
Reported by FlawFinder.
drivers/net/wireless/ath/ath9k/common-init.c
2 issues
Line: 140
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!channels)
return -ENOMEM;
memcpy(channels, ath9k_2ghz_chantable,
sizeof(ath9k_2ghz_chantable));
common->sbands[NL80211_BAND_2GHZ].channels = channels;
common->sbands[NL80211_BAND_2GHZ].band = NL80211_BAND_2GHZ;
common->sbands[NL80211_BAND_2GHZ].n_channels =
ARRAY_SIZE(ath9k_2ghz_chantable);
Reported by FlawFinder.
Line: 157
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!channels)
return -ENOMEM;
memcpy(channels, ath9k_5ghz_chantable,
sizeof(ath9k_5ghz_chantable));
common->sbands[NL80211_BAND_5GHZ].channels = channels;
common->sbands[NL80211_BAND_5GHZ].band = NL80211_BAND_5GHZ;
common->sbands[NL80211_BAND_5GHZ].n_channels =
ARRAY_SIZE(ath9k_5ghz_chantable);
Reported by FlawFinder.
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h
2 issues
Line: 37
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
__entry->subcode = req->msg.subcode;
__assign_str(pciname, pci_name(hdev->pdev));
__assign_str(devname, &hdev->vport[0].nic.kinfo.netdev->name);
memcpy(__entry->mbx_data, req,
sizeof(struct hclge_mbx_vf_to_pf_cmd));
),
TP_printk(
"%s %s vfid:%u code:%u subcode:%u data:%s",
Reported by FlawFinder.
Line: 68
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
__entry->code = req->msg.code;
__assign_str(pciname, pci_name(hdev->pdev));
__assign_str(devname, &hdev->vport[0].nic.kinfo.netdev->name);
memcpy(__entry->mbx_data, req,
sizeof(struct hclge_mbx_pf_to_vf_cmd));
),
TP_printk(
"%s %s vfid:%u code:%u data:%s",
Reported by FlawFinder.
drivers/net/wireless/ath/ath9k/dynack.c
2 issues
Line: 253
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* ether_addr_copy() gives a false warning on gcc-10 so use memcpy()
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97490
*/
memcpy(da->st_rbf.addr[da->st_rbf.t_rb].h_dest, hdr->addr1, ETH_ALEN);
memcpy(da->st_rbf.addr[da->st_rbf.t_rb].h_src, hdr->addr2, ETH_ALEN);
if (!(info->status.rates[ridx].flags & IEEE80211_TX_RC_MCS)) {
const struct ieee80211_rate *rate;
struct ieee80211_tx_rate *rates = info->status.rates;
Reported by FlawFinder.
Line: 254
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97490
*/
memcpy(da->st_rbf.addr[da->st_rbf.t_rb].h_dest, hdr->addr1, ETH_ALEN);
memcpy(da->st_rbf.addr[da->st_rbf.t_rb].h_src, hdr->addr2, ETH_ALEN);
if (!(info->status.rates[ridx].flags & IEEE80211_TX_RC_MCS)) {
const struct ieee80211_rate *rate;
struct ieee80211_tx_rate *rates = info->status.rates;
u32 phy;
Reported by FlawFinder.