The following issues were found
drivers/net/dsa/hirschmann/hellcreek_hwtstamp.c
1 issues
Line: 134
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return err;
/* Save the chosen configuration to be returned later */
memcpy(&ps->tstamp_config, &config, sizeof(config));
return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ?
-EFAULT : 0;
}
Reported by FlawFinder.
drivers/net/dsa/hirschmann/hellcreek_ptp.c
1 issues
Line: 391
Column: 2
CWE codes:
134
Suggestion:
Use a constant for the format specification
/* Setup PTP clock */
hellcreek->ptp_clock_info.owner = THIS_MODULE;
snprintf(hellcreek->ptp_clock_info.name,
sizeof(hellcreek->ptp_clock_info.name),
dev_name(hellcreek->dev));
/* IP-Core can add up to 0.5 ns per 8 ns cycle, which means
* accumulator_overflow_rate shall not exceed 62.5 MHz (which adjusts
Reported by FlawFinder.
drivers/net/dsa/lan9303-core.c
1 issues
Line: 987
Column: 3
CWE codes:
120
return;
for (u = 0; u < ARRAY_SIZE(lan9303_mib); u++) {
strncpy(data + u * ETH_GSTRING_LEN, lan9303_mib[u].name,
ETH_GSTRING_LEN);
}
}
static void lan9303_get_ethtool_stats(struct dsa_switch *ds, int port,
Reported by FlawFinder.
drivers/net/dsa/lan9303_mdio.c
1 issues
Line: 45
Column: 20
CWE codes:
120
20
static u16 lan9303_mdio_real_read(struct mdio_device *mdio, int reg)
{
return mdio->bus->read(mdio->bus, PHY_ADDR(reg), PHY_REG(reg));
}
static int lan9303_mdio_read(void *ctx, uint32_t reg, uint32_t *val)
{
struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx;
Reported by FlawFinder.
drivers/md/dm-kcopyd.c
1 issues
Line: 794
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
job->write_err = 0;
job->num_dests = num_dests;
memcpy(&job->dests, dests, sizeof(*dests) * num_dests);
/*
* If one of the destination is a host-managed zoned block device,
* we need to write sequentially. If one of the destination is a
* host-aware device, then leave it to the caller to choose what to do.
Reported by FlawFinder.
drivers/net/dsa/microchip/ksz_common.h
1 issues
Line: 39
Column: 6
CWE codes:
120
20
u32 fiber:1; /* port is fiber */
u32 sgmii:1; /* port is SGMII */
u32 force:1;
u32 read:1; /* read MIB counters in background */
u32 freeze:1; /* MIB counter freeze is enabled */
struct ksz_port_mib mib;
phy_interface_t interface;
};
Reported by FlawFinder.
drivers/net/dsa/mv88e6xxx/hwtstamp.c
1 issues
Line: 194
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return err;
/* Save the chosen configuration to be returned later. */
memcpy(&ps->tstamp_config, &config, sizeof(config));
return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ?
-EFAULT : 0;
}
Reported by FlawFinder.
drivers/net/dsa/qca/ar9331.c
1 issues
Line: 694
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct ar9331_sw_port *p = &priv->port[port];
spin_lock(&p->stats_lock);
memcpy(s, &p->stats, sizeof(*s));
spin_unlock(&p->stats_lock);
}
static const struct dsa_switch_ops ar9331_sw_ops = {
.get_tag_protocol = ar9331_sw_get_tag_protocol,
Reported by FlawFinder.
drivers/media/dvb-frontends/stv090x_priv.h
1 issues
drivers/net/dsa/realtek-smi-core.h
1 issues
Line: 73
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
int vlan_enabled;
int vlan4k_enabled;
char buf[4096];
void *chip_data; /* Per-chip extra variant data */
};
/**
* struct realtek_smi_ops - vtable for the per-SMI-chiptype operations
Reported by FlawFinder.