The following issues were found
drivers/clocksource/ingenic-timer.c
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
unsigned int channel;
struct clock_event_device cevt;
struct clk *clk;
char name[8];
};
struct ingenic_tcu {
struct regmap *map;
struct device_node *np;
Reported by FlawFinder.
drivers/clocksource/samsung_pwm_timer.c
1 issues
Line: 408
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
{
pwm.base = base;
memcpy(&pwm.variant, variant, sizeof(pwm.variant));
memcpy(pwm.irq, irqs, SAMSUNG_PWM_NUM * sizeof(*irqs));
pwm.timerclk = clk_get(NULL, "timers");
if (IS_ERR(pwm.timerclk))
panic("failed to get timers clock for timer");
Reported by FlawFinder.
drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c
1 issues
Line: 215
Column: 3
CWE codes:
134
Suggestion:
Use a constant for the format specification
va_list args;
va_start(args, name_fmt);
vsnprintf(c->name, sizeof(c->name), name_fmt, args);
va_end(args);
}
if (num)
*num = *num + 1;
Reported by FlawFinder.
drivers/comedi/comedidev.h
1 issues
Line: 575
Column: 8
CWE codes:
362
struct fasync_struct *async_queue;
int (*open)(struct comedi_device *dev);
void (*close)(struct comedi_device *dev);
int (*insn_device_config)(struct comedi_device *dev,
struct comedi_insn *insn, unsigned int *data);
unsigned int (*get_valid_routes)(struct comedi_device *dev,
unsigned int n_pairs,
Reported by FlawFinder.
drivers/comedi/drivers/addi_apci_3120.c
1 issues
Line: 925
CWE codes:
758
}
if (!dmabuf->virt)
break;
dmabuf->size = PAGE_SIZE << order;
if (i == 0)
devpriv->use_dma = 1;
if (i == 1)
devpriv->use_double_buffer = 1;
Reported by Cppcheck.
drivers/comedi/drivers/adl_pci9118.c
1 issues
Line: 1478
CWE codes:
758
}
if (!dmabuf->virt)
break;
dmabuf->size = PAGE_SIZE << order;
if (i == 0)
devpriv->master = 1;
if (i == 1)
devpriv->dma_doublebuf = 1;
Reported by Cppcheck.
drivers/comedi/drivers/ni_670x.c
1 issues
Line: 210
CWE codes:
758
s->range_table_list = range_table_list;
for (i = 0; i < 16; i++) {
range_table_list[i] = &range_bipolar10;
range_table_list[16 + i] = &range_0_20mA;
}
} else {
s->range_table = &range_bipolar10;
}
s->insn_write = ni_670x_ao_insn_write;
Reported by Cppcheck.
drivers/comedi/drivers/ni_at_ao.c
1 issues
Line: 112
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
unsigned short cfg3;
/* Used for caldac readback */
unsigned char caldac[21];
};
static void atao_select_reg_group(struct comedi_device *dev, int group)
{
struct atao_private *devpriv = dev->private;
Reported by FlawFinder.
drivers/comedi/drivers/ni_pcidio.c
1 issues
Line: 846
Column: 15
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
static int pci_6534_upload_firmware(struct comedi_device *dev)
{
struct nidio96_private *devpriv = dev->private;
static const char *const fw_file[3] = {
FW_PCI_6534_SCARAB_DI, /* loaded into scarab A for DI */
FW_PCI_6534_SCARAB_DO, /* loaded into scarab B for DO */
FW_PCI_6534_MAIN, /* loaded into main FPGA */
};
int ret;
Reported by FlawFinder.
drivers/comedi/drivers/ni_routing/ni_device_routes/pci-6070e.c
1 issues
Line: 32
struct ni_device_routes ni_pci_6070e_device_routes = {
.device = "pci-6070e",
.routes = (struct ni_route_set[]){
{
.dest = NI_PFI(0),
.src = (int[]){
NI_AI_StartTrigger,
0, /* Termination */
Reported by Cppcheck.