The following issues were found
drivers/infiniband/hw/qib/qib_sdma.c
1 issues
Line: 704
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
/* print info for each entry in the descriptor queue */
while (head != tail) {
char flags[6] = { 'x', 'x', 'x', 'x', 'x', 0 };
descqp = &descq[head].qw[0];
desc[0] = le64_to_cpu(descqp[0]);
desc[1] = le64_to_cpu(descqp[1]);
flags[0] = (desc[0] & 1<<15) ? 'I' : '-';
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm200.c
1 issues
Line: 161
if (post) {
nvkm_wr32(device, 0x10a040, 0x00005000);
pmu_exec(init, exec);
if (nvkm_msec(device, 2000,
if (nvkm_rd32(device, 0x10a040) & 0x00002000)
break;
) < 0)
return -ETIMEDOUT;
}
Reported by Cppcheck.
drivers/gpu/drm/nouveau/nvkm/subdev/clk/priv.h
1 issues
Line: 10
Column: 8
CWE codes:
120
20
struct nvkm_clk_func {
int (*init)(struct nvkm_clk *);
void (*fini)(struct nvkm_clk *);
int (*read)(struct nvkm_clk *, enum nv_clk_src);
int (*calc)(struct nvkm_clk *, struct nvkm_cstate *);
int (*prog)(struct nvkm_clk *);
void (*tidy)(struct nvkm_clk *);
struct nvkm_pstate *pstates;
int nr_pstates;
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c
1 issues
Line: 353
goto resume;
}
if (nvkm_msec(device, 2000,
u32 tmp = nvkm_rd32(device, 0x004080) & pllmask;
if (tmp == pllmask)
break;
) < 0)
goto resume;
Reported by Cppcheck.
drivers/infiniband/hw/usnic/usnic_common_util.h
1 issues
Line: 45
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
raw_gid[0] = 0xfe;
raw_gid[1] = 0x80;
memset(&raw_gid[2], 0, 2);
memcpy(&raw_gid[4], &inaddr, 4);
addrconf_addr_eui48(&raw_gid[8], mac);
}
#endif /* USNIC_COMMON_UTIL_H */
Reported by FlawFinder.
drivers/gpu/drm/i915/gem/selftests/mock_context.c
1 issues
Line: 45
Column: 3
CWE codes:
120
if (name) {
struct i915_ppgtt *ppgtt;
strncpy(ctx->name, name, sizeof(ctx->name) - 1);
ppgtt = mock_ppgtt(i915, name);
if (!ppgtt)
goto err_put;
Reported by FlawFinder.
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
1 issues
Line: 1757
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
vaddr = __px_vaddr(vm->scratch[0]);
memcpy(out, vaddr, sizeof(*out));
if (memchr_inv(vaddr, *out, PAGE_SIZE)) {
pr_err("Inconsistent initial state of scratch page!\n");
err = -EINVAL;
}
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c
1 issues
Line: 316
nvkm_mask(device, 0x020060, 0x00070000, 0x00000000);
nvkm_mask(device, 0x002504, 0x00000001, 0x00000001);
/* Wait until the interrupt handler is finished */
if (nvkm_msec(device, 2000,
if (!nvkm_rd32(device, 0x000100))
break;
) < 0)
return -EBUSY;
Reported by Cppcheck.
drivers/infiniband/hw/usnic/usnic_ib_main.c
1 issues
Line: 430
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
usnic_mac_ip_to_gid(us_ibdev->netdev->perm_addr,
us_ibdev->ufdev->inaddr, &gid.raw[0]);
memcpy(&us_ibdev->ib_dev.node_guid, &gid.global.interface_id,
sizeof(gid.global.interface_id));
kref_init(&us_ibdev->vf_cnt);
usnic_info("Added ibdev: %s netdev: %s with mac %pM Link: %u MTU: %u\n",
dev_name(&us_ibdev->ib_dev.dev),
Reported by FlawFinder.
drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
1 issues
Line: 631
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 void log_spec(struct usnic_vnic_res_spec *res_spec)
{
char buf[512];
usnic_vnic_spec_dump(buf, sizeof(buf), res_spec);
usnic_dbg("%s\n", buf);
}
static int qp_grp_id_from_flow(struct usnic_ib_qp_grp_flow *qp_flow,
Reported by FlawFinder.