The following issues were found
drivers/net/ethernet/smsc/smsc9420.c
1 issues
Line: 361
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
}
memcpy(data, &eeprom_data[eeprom->offset], len);
eeprom->magic = SMSC9420_EEPROM_MAGIC;
eeprom->len = len;
return 0;
}
Reported by FlawFinder.
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
1 issues
Line: 744
CWE codes:
908
* index all over the driver - check that its value corresponds to the
* array size.
*/
BUILD_BUG_ON(ARRAY_SIZE(mvm->fw_id_to_mac_id) !=
IWL_MVM_STATION_COUNT_MAX);
/********************************
* 1. Allocating and configuring HW data
********************************/
Reported by Cppcheck.
drivers/net/ethernet/smsc/smc91x.h
1 issues
Line: 733
Column: 14
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
#define CHIP_91100FD 8
#define CHIP_91111FD 9
static const char * chip_ids[ 16 ] = {
NULL, NULL, NULL,
/* 3 */ "SMC91C90/91C92",
/* 4 */ "SMC91C94",
/* 5 */ "SMC91C95",
/* 6 */ "SMC91C96",
Reported by FlawFinder.
drivers/net/ethernet/smsc/smc911x.c
1 issues
Line: 1652
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if ((ret=smc911x_ethtool_read_eeprom_byte(dev, &eebuf[i]))!=0)
return ret;
}
memcpy(data, eebuf+eeprom->offset, eeprom->len);
return 0;
}
static int smc911x_ethtool_seteeprom(struct net_device *dev,
struct ethtool_eeprom *eeprom, u8 *data)
Reported by FlawFinder.
drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
1 issues
Line: 208
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
static void ehea_get_strings(struct net_device *dev, u32 stringset, u8 *data)
{
if (stringset == ETH_SS_STATS) {
memcpy(data, &ehea_ethtool_stats_keys,
sizeof(ehea_ethtool_stats_keys));
}
}
static int ehea_get_sset_count(struct net_device *dev, int sset)
Reported by FlawFinder.
drivers/net/ethernet/sis/sis900.c
1 issues
Line: 2193
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
res = sis900_read_eeprom(dev, eebuf);
spin_unlock_irq(&sis_priv->lock);
if (!res)
memcpy(data, eebuf + eeprom->offset, eeprom->len);
kfree(eebuf);
return res;
}
static const struct ethtool_ops sis900_ethtool_ops = {
Reported by FlawFinder.
drivers/net/ethernet/sfc/nic.c
1 issues
Line: 507
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (generation_end == EFX_MC_STATS_GENERATION_INVALID)
goto return_zeroes;
rmb();
memcpy(dest, dma_stats, efx->num_mac_stats * sizeof(__le64));
rmb();
generation_start = dma_stats[MC_CMD_MAC_GENERATION_START];
if (generation_end == generation_start)
return 0; /* return good data */
udelay(100);
Reported by FlawFinder.
drivers/net/ethernet/sfc/falcon/falcon_boards.c
1 issues
Line: 361
Column: 9
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
struct device_attribute *attr, char *buf)
{
struct ef4_nic *efx = dev_get_drvdata(dev);
return sprintf(buf, "%d\n", !!(efx->phy_mode & PHY_MODE_SPECIAL));
}
static ssize_t phy_flash_cfg_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
Reported by FlawFinder.
drivers/net/ethernet/intel/ice/ice_dcb_nl.c
1 issues
Line: 383
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (state) {
set_bit(ICE_FLAG_DCB_ENA, pf->flags);
memcpy(&pf->hw.port_info->qos_cfg.desired_dcbx_cfg,
&pf->hw.port_info->qos_cfg.local_dcbx_cfg,
sizeof(struct ice_dcbx_cfg));
} else {
clear_bit(ICE_FLAG_DCB_ENA, pf->flags);
}
Reported by FlawFinder.
drivers/net/ethernet/sfc/efx_channels.c
1 issues
Line: 1155
CWE codes:
562
/* Prepare the batch receive list */
EFX_WARN_ON_PARANOID(channel->rx_list != NULL);
INIT_LIST_HEAD(&rx_list);
channel->rx_list = &rx_list;
efx_for_each_channel_tx_queue(tx_queue, channel) {
tx_queue->pkts_compl = 0;
tx_queue->bytes_compl = 0;
}
Reported by Cppcheck.