The following issues were found
drivers/infiniband/hw/qib/qib_file_ops.c
1 issues
Line: 2363
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 qib_user_add(struct qib_devdata *dd)
{
char name[10];
int ret;
if (atomic_inc_return(&user_count) == 1) {
ret = qib_cdev_init(0, "ipath", &qib_file_ops,
&wildcard_cdev, &wildcard_device);
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c
1 issues
Line: 316
CWE codes:
908
struct nv50_instobj *iobj = nv50_instobj(memory);
struct nvkm_instmem *imem = &iobj->imem->base;
struct nvkm_vma *bar;
void *map = map;
mutex_lock(&imem->mutex);
if (likely(iobj->lru.next))
list_del(&iobj->lru);
map = iobj->map;
Reported by Cppcheck.
drivers/gpu/drm/i915/gt/gen6_ppgtt.c
1 issues
Line: 370
Column: 42
CWE codes:
362
struct gen6_ppgtt *ppgtt = to_gen6_ppgtt(base);
int err;
GEM_BUG_ON(!atomic_read(&ppgtt->base.vm.open));
/*
* Workaround the limited maximum vma->pin_count and the aliasing_ppgtt
* which will be pinned into every active context.
* (When vma->pin_count becomes atomic, I expect we will naturally
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/priv.h
1 issues
Line: 19
Column: 8
CWE codes:
120
20
struct nvkm_iccsense_rail {
struct list_head head;
int (*read)(struct nvkm_iccsense *, struct nvkm_iccsense_rail *);
struct nvkm_iccsense_sensor *sensor;
u8 idx;
u8 mohm;
};
Reported by FlawFinder.
drivers/infiniband/hw/qib/qib_init.c
1 issues
Line: 584
Column: 4
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
for (pidx = 0; pidx < dd->num_pports; ++pidx) {
ppd = dd->pport + pidx;
if (!ppd->qib_wq) {
char wq_name[8]; /* 3 + 2 + 1 + 1 + 1 */
snprintf(wq_name, sizeof(wq_name), "qib%d_%d",
dd->unit, pidx);
ppd->qib_wq = alloc_ordered_workqueue(wq_name,
WQ_MEM_RECLAIM);
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/fuse/priv.h
1 issues
Line: 8
Column: 8
CWE codes:
120
20
#include <subdev/fuse.h>
struct nvkm_fuse_func {
u32 (*read)(struct nvkm_fuse *, u32 addr);
};
int nvkm_fuse_new_(const struct nvkm_fuse_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
struct nvkm_fuse **);
#endif
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c
1 issues
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
1 issues
Line: 238
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 resource *res;
void __iomem *base;
struct clk *pix_clk_in;
char pix_clk_name[32];
const char *pix_clk_in_name;
const struct of_device_id *id;
int ret;
u8 div_ratio_shift = 0;
Reported by FlawFinder.
drivers/infiniband/hw/qib/qib_rc.c
1 issues
Line: 694
CWE codes:
758
qib_flush_wc();
qib_pio_copy(piobuf + 2, hdrp, hwords - 1);
qib_flush_wc();
__raw_writel(hdrp[hwords - 1], piobuf + hwords + 1);
} else
qib_pio_copy(piobuf + 2, (u32 *) &hdr, hwords);
if (dd->flags & QIB_USE_SPCL_TRIG) {
u32 spcl_off = (pbufn >= dd->piobcnt2k) ? 2047 : 1023;
Reported by Cppcheck.
drivers/infiniband/hw/qib/qib_sd7220.c
1 issues
Line: 886
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
const u8 *img, int len, int offset)
{
int cnt, sofar, req, idx, errors;
unsigned char readback[VFY_CHUNK];
errors = 0;
sofar = 0;
while (sofar < len) {
req = len - sofar;
Reported by FlawFinder.