The following issues were found
drivers/infiniband/sw/rxe/rxe_queue.c
1 issues
Line: 118
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return -EINVAL;
while (!queue_empty(q, q->type)) {
memcpy(producer_addr(new_q, new_q->type),
consumer_addr(q, q->type),
new_q->elem_size);
advance_producer(new_q, new_q->type);
advance_consumer(q, q->type);
}
Reported by FlawFinder.
drivers/leds/leds-lm3697.c
1 issues
Line: 55
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 lm3697_led {
u32 hvled_strings[LM3697_MAX_LED_STRINGS];
char label[LED_MAX_NAME_SIZE];
struct led_classdev led_dev;
struct lm3697 *priv;
struct ti_lmu_bank lmu_data;
int control_bank;
int enabled;
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/bar/tu102.c
1 issues
Line: 31
tu102_bar_bar2_wait(struct nvkm_bar *bar)
{
struct nvkm_device *device = bar->subdev.device;
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0xb80f50) & 0x0000000c))
break;
);
}
Reported by Cppcheck.
drivers/gpu/drm/exynos/exynos_hdmi.c
1 issues
Line: 1646
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct hdmi_context *hdata = dev_get_drvdata(dev);
struct drm_connector *connector = &hdata->connector;
memcpy(buf, connector->eld, min(sizeof(connector->eld), len));
return 0;
}
static const struct hdmi_codec_ops audio_codec_ops = {
Reported by FlawFinder.
drivers/infiniband/sw/rxe/rxe_task.h
1 issues
Line: 29
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
void *arg;
int (*func)(void *arg);
int ret;
char name[16];
bool destroyed;
};
/*
* init rxe_task structure
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c
1 issues
Line: 39
unsigned long flags;
spin_lock_irqsave(&bar->base.lock, flags);
nvkm_wr32(device, 0x00330c, 0x00000001);
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x00330c) & 0x00000002))
break;
);
spin_unlock_irqrestore(&bar->base.lock, flags);
}
Reported by Cppcheck.
drivers/gpu/drm/nouveau/nvkm/subdev/bar/gm107.c
1 issues
Line: 30
gm107_bar_bar1_wait(struct nvkm_bar *bar)
{
struct nvkm_device *device = bar->subdev.device;
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x001710) & 0x00000003))
break;
);
}
Reported by Cppcheck.
drivers/gpu/drm/i915/gem/i915_gem_shmem.c
1 issues
Line: 584
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
goto fail;
vaddr = kmap(page);
memcpy(vaddr, data, len);
kunmap(page);
err = pagecache_write_end(file, file->f_mapping,
offset, len, len,
page, pgdata);
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/subdev/bar/g84.c
1 issues
Line: 35
unsigned long flags;
spin_lock_irqsave(&bar->lock, flags);
nvkm_wr32(device, 0x070000, 0x00000001);
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x070000) & 0x00000002))
break;
);
spin_unlock_irqrestore(&bar->lock, flags);
}
Reported by Cppcheck.
drivers/gpu/drm/nouveau/nvkm/subdev/acr/gp102.c
1 issues
Line: 67
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (WARN_ON(lsfw->sig->size != sizeof(hdr.signature)))
return -EINVAL;
memcpy(&hdr.signature, lsfw->sig->data, lsfw->sig->size);
gm200_acr_wpr_build_lsb_tail(lsfw, &hdr.tail);
nvkm_wobj(acr->wpr, lsfw->offset.lsb, &hdr, sizeof(hdr));
return 0;
}
Reported by FlawFinder.