The following issues were found
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
1 issues
Line: 108
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
};
#endif
static const char * const pm8xxx_groups[PM8XXX_MAX_GPIOS] = {
"gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8",
"gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15",
"gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", "gpio22",
"gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", "gpio29",
"gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", "gpio36",
Reported by FlawFinder.
drivers/pinctrl/qcom/pinctrl-qdf2xxx.c
1 issues
Line: 36
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 msm_pinctrl_soc_data *pinctrl;
struct pinctrl_pin_desc *pins;
struct msm_pingroup *groups;
char (*names)[NAME_SIZE];
unsigned int i;
u32 num_gpios;
unsigned int avail_gpios; /* The number of GPIOs we support */
u8 gpios[MAX_GPIOS]; /* An array of supported GPIOs */
int ret;
Reported by FlawFinder.
drivers/pinctrl/pxa/pinctrl-pxa2xx.c
1 issues
Line: 325
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!func->groups)
return -ENOMEM;
memcpy(func->groups, gtmp, ngroups * sizeof(*gtmp));
}
devm_kfree(pctl->dev, gtmp);
return 0;
}
Reported by FlawFinder.
drivers/pinctrl/pinctrl-pistachio.c
1 issues
Line: 1356
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
int irq, ret = 0;
for (i = 0; i < pctl->nbanks; i++) {
char child_name[sizeof("gpioXX")];
struct device_node *child;
struct gpio_irq_chip *girq;
snprintf(child_name, sizeof(child_name), "gpio%d", i);
child = of_get_child_by_name(node, child_name);
Reported by FlawFinder.
drivers/pinctrl/pinctrl-ocelot.c
1 issues
Line: 147
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
struct ocelot_pin_caps {
unsigned int pin;
unsigned char functions[OCELOT_FUNC_PER_PIN];
};
struct ocelot_pinctrl {
struct device *dev;
struct pinctrl_dev *pctl;
Reported by FlawFinder.
drivers/pinctrl/pinctrl-lpc18xx.c
1 issues
Line: 195
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
struct lpc18xx_pin_caps {
unsigned int offset;
unsigned char functions[LPC18XX_SCU_FUNC_PER_PIN];
unsigned char analog;
unsigned char type;
};
/* Analog pins are required to have both bias and input disabled */
Reported by FlawFinder.
drivers/pinctrl/pinctrl-k210.c
1 issues
Line: 190
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
* Pin functions configuration information.
*/
struct k210_pcf_info {
char name[15];
u8 mode_id;
};
#define K210_FUNC(id, mode) \
[K210_PCF_##id] = { \
Reported by FlawFinder.
drivers/sbus/char/uctrl.c
1 issues
Line: 72
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 UCTRL_STAT_RXO_STA 0x08 /* receive FIFO overflow status */
static DEFINE_MUTEX(uctrl_mutex);
static const char *uctrl_extstatus[16] = {
"main power available",
"internal battery attached",
"external battery attached",
"external VGA attached",
"external keyboard attached",
Reported by FlawFinder.
drivers/pinctrl/pinctrl-gemini.c
1 issues
Line: 2459
CWE codes:
476
grp = &gemini_3516_pin_groups[selector];
/* First figure out if this group supports configs */
if (!grp->driving_mask) {
dev_err(pmx->dev, "pin config group \"%s\" does "
"not support drive strength setting\n",
grp->name);
return -EINVAL;
}
Reported by Cppcheck.
drivers/pinctrl/pinctrl-equilibrium.c
1 issues
Line: 796
Column: 3
CWE codes:
134
Suggestion:
Make format string constant
return -ENOMEM;
for (i = 0; i < nr_pins; i++) {
sprintf(pin_names, PIN_NAME_FMT, i);
pdesc[i].number = i;
pdesc[i].name = pin_names;
pin_names += PIN_NAME_LEN;
}
pctl_desc->pins = pdesc;
Reported by FlawFinder.