The following issues were found
drivers/pinctrl/pinctrl-amd.c
1 issues
Line: 223
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
char *pull_down_enable;
char *output_value;
char *output_enable;
char debounce_value[40];
char *debounce_enable;
for (bank = 0; bank < gpio_dev->hwbank_num; bank++) {
seq_printf(s, "GPIO bank%d\t", bank);
Reported by FlawFinder.
drivers/pinctrl/mvebu/pinctrl-dove.c
1 issues
Line: 802
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
mpp_data[i].base = base;
/* prepare fallback resource */
memcpy(&fb_res, mpp_res, sizeof(struct resource));
fb_res.start = 0;
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res) {
dev_warn(&pdev->dev, "falling back to hardcoded MPP4 resource\n");
Reported by FlawFinder.
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
1 issues
Line: 67
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
u32 val[NB_FUNCS];
unsigned int extra_pin;
unsigned int extra_npins;
const char *funcs[NB_FUNCS];
unsigned int *pins;
};
struct armada_37xx_pin_data {
u8 nr_pins;
Reported by FlawFinder.
drivers/pinctrl/mediatek/pinctrl-paris.c
1 issues
Line: 642
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
unsigned int gpio)
{
struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev);
char buf[PIN_DBG_BUF_SZ];
(void)mtk_pctrl_show_one_pin(hw, gpio, buf, PIN_DBG_BUF_SZ);
seq_printf(s, "%s", buf);
}
Reported by FlawFinder.
drivers/pinctrl/devicetree.c
1 issues
Line: 244
Column: 29
CWE codes:
126
* just point part way into the property name for the string.
*/
if (ret < 0)
statename = prop->name + strlen("pinctrl-");
/* For every referenced pin configuration node in it */
for (config = 0; config < size; config++) {
phandle = be32_to_cpup(list++);
Reported by FlawFinder.
drivers/scsi/53c700.h
1 issues
Line: 83
Column: 11
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
/* space for creating a request sense command. Really, except
* for the annoying SCSI-2 requirement for LUN information in
* cmnd[1], this could be in static storage */
unsigned char cmnd[MAX_COMMAND_SIZE];
__u8 depth;
struct scsi_cmnd *current_cmnd; /* currently active command */
};
Reported by FlawFinder.
drivers/phy/xilinx/phy-zynqmp.c
1 issues
Line: 893
Column: 3
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
unsigned long rate;
unsigned int i;
struct clk *clk;
char name[8];
snprintf(name, sizeof(name), "ref%u", refclk);
clk = devm_clk_get_optional(gtr_dev->dev, name);
if (IS_ERR(clk)) {
ret = dev_err_probe(gtr_dev->dev, PTR_ERR(clk),
Reported by FlawFinder.
drivers/phy/ti/phy-twl4030-usb.c
1 issues
Line: 554
Column: 8
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
int ret = -EINVAL;
mutex_lock(&twl->lock);
ret = sprintf(buf, "%s\n",
twl->vbus_supplied ? "on" : "off");
mutex_unlock(&twl->lock);
return ret;
}
Reported by FlawFinder.
drivers/phy/samsung/phy-exynos-mipi-video.c
1 issues
Line: 43
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
struct mipi_phy_device_desc {
int num_phys;
int num_regmaps;
const char *regmap_names[EXYNOS_MIPI_REGMAPS_NUM];
struct exynos_mipi_phy_desc {
enum exynos_mipi_phy_id coupled_phy_id;
u32 enable_val;
unsigned int enable_reg;
enum exynos_mipi_phy_regmap_id enable_map;
Reported by FlawFinder.
drivers/phy/renesas/phy-rcar-gen3-usb2.c
1 issues
Line: 363
Column: 9
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
if (!ch->is_otg_channel || !rcar_gen3_is_any_rphy_initialized(ch))
return -EIO;
return sprintf(buf, "%s\n", rcar_gen3_is_host(ch) ? "host" :
"peripheral");
}
static DEVICE_ATTR_RW(role);
static void rcar_gen3_init_otg(struct rcar_gen3_chan *ch)
Reported by FlawFinder.