The following issues were found
drivers/net/ethernet/intel/igc/igc_mac.c
1 issues
Line: 842
CWE codes:
476
break;
}
hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
(((u16)mc_addr[5]) << bit_shift)));
return hash_value;
}
Reported by Cppcheck.
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c
1 issues
Line: 39
Column: 2
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
{
struct dpaa2_eth_devlink_priv *dl_priv = devlink_priv(devlink);
struct dpaa2_eth_priv *priv = dl_priv->dpaa2_priv;
char buf[10];
int err;
err = devlink_info_driver_name_put(req, KBUILD_MODNAME);
if (err)
return err;
Reported by FlawFinder.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
1 issues
Line: 497
Column: 2
CWE codes:
134
Suggestion:
Use a constant for the format specification
const char *fmt;
fmt = ((id > 0xa000) || (id < 0x4000)) ? "BCM%d/%u" : "BCM%x/%u";
snprintf(buf, len, fmt, id, rev);
return buf;
}
static struct brcmf_core *brcmf_chip_add_core(struct brcmf_chip_priv *ci,
u16 coreid, u32 base,
Reported by FlawFinder.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
1 issues
Line: 37
Column: 2
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
u32 rambase;
u32 ramsize;
u32 srsize;
char name[12];
};
/**
* struct brcmf_core - core related information.
*
Reported by FlawFinder.
drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
1 issues
Line: 128
Column: 2
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
struct mlxsw_sp_mr_tcam_erif_list *erif_list)
{
struct mlxsw_sp_mr_erif_sublist *curr_sublist;
char rigr2_pl[MLXSW_REG_RIGR2_LEN];
int err;
int i;
list_for_each_entry(curr_sublist, &erif_list->erif_sublists, list) {
if (curr_sublist->synced)
Reported by FlawFinder.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
1 issues
Line: 28
Column: 2
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
* @firmware_path: Alternative firmware path.
*/
struct brcmf_mp_global_t {
char firmware_path[BRCMF_FW_ALTPATH_LEN];
};
extern struct brcmf_mp_global_t brcmf_mp_global;
/**
Reported by FlawFinder.
drivers/net/ethernet/hisilicon/hisi_femac.c
1 issues
Line: 558
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!is_valid_ether_addr(skaddr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, skaddr->sa_data, dev->addr_len);
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
hisi_femac_set_hw_mac_addr(priv, dev->dev_addr);
return 0;
Reported by FlawFinder.
drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c
1 issues
Line: 96
Column: 2
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
bool enable, u32 rate)
{
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
char mpsc_pl[MLXSW_REG_MPSC_LEN];
mlxsw_reg_mpsc_pack(mpsc_pl, mlxsw_sp_port->local_port, enable, rate);
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mpsc), mpsc_pl);
}
Reported by FlawFinder.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
1 issues
Line: 33
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return -ENOMEM;
if (data && len > 0)
memcpy(dump, data, len);
err = brcmf_bus_get_memdump(bus, dump + len, ramsize);
if (err) {
vfree(dump);
return err;
}
Reported by FlawFinder.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
1 issues
Line: 13
Column: 8
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
#include "brcm_hw_ids.h"
/* The DMI data never changes so we can use a static buf for this */
static char dmi_board_type[128];
struct brcmf_dmi_data {
u32 chip;
u32 chiprev;
const char *board_type;
Reported by FlawFinder.