The following issues were found
drivers/media/pci/tw686x/tw686x.h
1 issues
Line: 125
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 v4l2_device v4l2_dev;
struct snd_card *snd_card;
char name[32];
unsigned int type;
unsigned int dma_mode;
struct pci_dev *pci_dev;
__u32 __iomem *mmio;
Reported by FlawFinder.
drivers/media/pci/tw686x/tw686x-video.c
1 issues
Line: 65
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
vb2_buf = &vb->vb2_buf;
if (dev->dma_mode == TW686X_DMA_MODE_MEMCPY)
memcpy(vb2_plane_vaddr(vb2_buf, 0), desc->virt,
desc->size);
vb2_buf->timestamp = ktime_get_ns();
vb2_buffer_done(vb2_buf, VB2_BUF_STATE_DONE);
}
Reported by FlawFinder.
drivers/misc/genwqe/genwqe_driver.h
1 issues
Line: 60
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
static inline void genwqe_hexdump(struct pci_dev *pci_dev,
const void *buff, unsigned int size)
{
char prefix[32];
scnprintf(prefix, sizeof(prefix), "%s %s: ",
GENWQE_DEVNAME, pci_name(pci_dev));
print_hex_dump_debug(prefix, DUMP_PREFIX_OFFSET, 16, 1, buff,
Reported by FlawFinder.
drivers/misc/habanalabs/common/device.c
1 issues
Line: 336
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
static int device_early_init(struct hl_device *hdev)
{
int i, rc;
char workq_name[32];
switch (hdev->asic_type) {
case ASIC_GOYA:
goya_set_asic_funcs(hdev);
strscpy(hdev->asic_name, "GOYA", sizeof(hdev->asic_name));
Reported by FlawFinder.
drivers/media/pci/tw686x/tw686x-audio.c
1 issues
Line: 70
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
*/
desc = &ac->dma_descs[pb];
if (desc->virt) {
memcpy(done->virt, desc->virt,
dev->period_size);
} else {
u32 reg = pb ? ADMA_B_ADDR[ch] : ADMA_P_ADDR[ch];
reg_write(dev, reg, next->dma);
}
Reported by FlawFinder.
drivers/media/pci/tw5864/tw5864.h
1 issues
Line: 160
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 next_input;
/* pci i/o */
char name[64];
struct pci_dev *pci;
void __iomem *mmio;
u32 irqmask;
};
Reported by FlawFinder.
drivers/media/cec/platform/tegra/tegra_cec.c
1 issues
Line: 85
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct cec_msg msg = {};
msg.len = cec->rx_buf_cnt;
memcpy(msg.msg, cec->rx_buf, msg.len);
cec_received_msg(cec->adap, &msg);
cec->rx_done = false;
cec->rx_buf_cnt = 0;
}
return IRQ_HANDLED;
Reported by FlawFinder.
drivers/media/cec/platform/seco/seco-cec.c
1 issues
Line: 31
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 cec_adapter *cec_adap;
struct cec_notifier *notifier;
struct rc_dev *ir;
char ir_input_phys[32];
int irq;
};
#define smb_wr16(cmd, data) smb_word_op(CMD_WORD_DATA, SECOCEC_MICRO_ADDRESS, \
cmd, data, SMBUS_WRITE, NULL)
Reported by FlawFinder.
drivers/misc/habanalabs/common/irq.c
1 issues
Line: 257
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
INIT_WORK(&handle_eqe_work->eq_work, irq_handle_eqe);
handle_eqe_work->hdev = hdev;
memcpy(&handle_eqe_work->eq_entry, eq_entry,
sizeof(*eq_entry));
queue_work(hdev->eq_wq, &handle_eqe_work->eq_work);
}
skip_irq:
Reported by FlawFinder.
drivers/misc/habanalabs/common/pci/pci.c
1 issues
Line: 30
Column: 51
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
*
* Return: 0 on success, non-zero for failure.
*/
int hl_pci_bars_map(struct hl_device *hdev, const char * const name[3],
bool is_wc[3])
{
struct pci_dev *pdev = hdev->pdev;
int rc, i, bar;
Reported by FlawFinder.