The following issues were found
drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c
1 issues
Line: 359
{
struct nvkm_device *device = clk->base.subdev.device;
nvkm_mask(device, 0x137100, (1 << idx), 0x00000000);
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x137100) & (1 << idx)))
break;
);
}
Reported by Cppcheck.
drivers/gpu/drm/nouveau/nvkm/subdev/bus/nv50.c
1 issues
Line: 43
nvkm_mask(device, 0x001098, 0x00000018, 0x00000018);
nvkm_wr32(device, 0x00130c, 0x00000003);
if (nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x001308) & 0x00000100))
break;
) < 0)
return -ETIMEDOUT;
Reported by Cppcheck.
drivers/infiniband/sw/rxe/rxe_cq.c
1 issues
Line: 142
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
else
addr = producer_addr(cq->queue, QUEUE_TYPE_KERNEL);
memcpy(addr, cqe, sizeof(*cqe));
if (cq->is_user)
advance_producer(cq->queue, QUEUE_TYPE_TO_USER);
else
advance_producer(cq->queue, QUEUE_TYPE_KERNEL);
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.c
1 issues
Line: 39
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
static void
hwsq_cmd(struct nvkm_hwsq *hwsq, int size, u8 data[])
{
memcpy(&hwsq->c.data[hwsq->c.size], data, size * sizeof(data[0]));
hwsq->c.size += size;
}
int
nvkm_hwsq_init(struct nvkm_subdev *subdev, struct nvkm_hwsq **phwsq)
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/bus/g94.c
1 issues
Line: 43
nvkm_mask(device, 0x001098, 0x00000018, 0x00000018);
nvkm_wr32(device, 0x00130c, 0x00000001);
if (nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x001308) & 0x00000100))
break;
) < 0)
return -ETIMEDOUT;
Reported by Cppcheck.
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c
1 issues
Line: 51
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
obj = (union acpi_object *)buffer.pointer;
length = min(length, obj->buffer.length);
memcpy(bios+offset, obj->buffer.pointer, length);
kfree(buffer.pointer);
return length;
#else
return -EINVAL;
#endif
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
1 issues
Line: 11
Column: 10
CWE codes:
120
20
const char *name;
void *(*init)(struct nvkm_bios *, const char *);
void (*fini)(void *);
u32 (*read)(void *, u32 offset, u32 length, struct nvkm_bios *);
u32 (*size)(void *);
bool rw;
bool ignore_checksum;
bool no_pcir;
bool require_checksum;
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c
1 issues
Line: 121
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
bios->data = prev;
return -ENOMEM;
}
memcpy(bios->data, prev, bios->size);
bios->size = length;
kfree(prev);
return 1;
}
return 0;
Reported by FlawFinder.
drivers/infiniband/sw/rxe/rxe_pool.c
1 issues
Line: 250
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct rxe_pool *pool = elem->pool;
int err;
memcpy((u8 *)elem + pool->key.key_offset, key, pool->key.key_size);
err = rxe_insert_key(pool, elem);
return err;
}
Reported by FlawFinder.
drivers/gpu/drm/i915/gem/selftests/huge_gem_object.c
1 issues
Line: 109
CWE codes:
908
GEM_BUG_ON(!IS_ALIGNED(phys_size, PAGE_SIZE));
GEM_BUG_ON(!IS_ALIGNED(dma_size, I915_GTT_PAGE_SIZE));
if (overflows_type(dma_size, obj->base.size))
return ERR_PTR(-E2BIG);
obj = i915_gem_object_alloc();
if (!obj)
return ERR_PTR(-ENOMEM);
Reported by Cppcheck.