The following issues were found
drivers/gpu/drm/nouveau/nvkm/engine/disp/piornv50.c
1 issues
Line: 51
static void
nv50_pior_power_wait(struct nvkm_device *device, u32 poff)
{
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x61e004 + poff) & 0x80000000))
break;
);
}
Reported by Cppcheck.
drivers/input/joystick/fsia6b.c
1 issues
Line: 59
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 input_dev *dev;
struct ibus_packet packet;
char phys[32];
};
static irqreturn_t fsia6b_serio_irq(struct serio *serio,
unsigned char data, unsigned int flags)
{
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/engine/disp/piocnv50.c
1 issues
Line: 39
int user = chan->chid.user;
nvkm_mask(device, 0x610200 + (ctrl * 0x10), 0x00000001, 0x00000000);
if (nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x610200 + (ctrl * 0x10)) & 0x00030000))
break;
) < 0) {
nvkm_error(subdev, "ch %d timeout: %08x\n", user,
nvkm_rd32(device, 0x610200 + (ctrl * 0x10)));
Reported by Cppcheck.
drivers/gpu/drm/nouveau/nvkm/engine/disp/piocgf119.c
1 issues
Line: 39
int user = chan->chid.user;
nvkm_mask(device, 0x610490 + (ctrl * 0x10), 0x00000001, 0x00000000);
if (nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x610490 + (ctrl * 0x10)) & 0x00030000))
break;
) < 0) {
nvkm_error(subdev, "ch %d fini: %08x\n", user,
nvkm_rd32(device, 0x610490 + (ctrl * 0x10)));
Reported by Cppcheck.
drivers/leds/leds-ns2.c
1 issues
Line: 164
Column: 9
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
struct led_classdev *led_cdev = dev_get_drvdata(dev);
struct ns2_led *led = container_of(led_cdev, struct ns2_led, cdev);
return sprintf(buf, "%d\n", led->sata);
}
static DEVICE_ATTR(sata, 0644, ns2_led_sata_show, ns2_led_sata_store);
static struct attribute *ns2_led_attrs[] = {
Reported by FlawFinder.
drivers/input/joystick/guillemot.c
1 issues
Line: 57
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 reads;
struct guillemot_type *type;
unsigned char length;
char phys[32];
};
static struct guillemot_type guillemot_type[] = {
{ 0x00, guillemot_abs_pad, guillemot_btn_pad, 1, "Guillemot Pad" },
{ 0 }};
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c
1 issues
Line: 741
if (nvkm_rd32(device, 0x610024) & 0x00000100) {
nvkm_wr32(device, 0x610024, 0x00000100);
nvkm_mask(device, 0x6194e8, 0x00000001, 0x00000000);
if (nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x6194e8) & 0x00000002))
break;
) < 0)
return -EBUSY;
}
Reported by Cppcheck.
drivers/leds/leds-pca955x.c
1 issues
Line: 130
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 pca955x *pca955x;
struct led_classdev led_cdev;
int led_num; /* 0 .. 15 potentially */
char name[32];
u32 type;
const char *default_trigger;
};
struct pca955x_platform_data {
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
1 issues
Line: 16
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
PIOR,
} type;
int id;
char name[8];
struct list_head head;
bool identity;
struct nvkm_ior_state {
Reported by FlawFinder.
drivers/leds/leds-pca963x.c
1 issues
Line: 325
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
device_for_each_child_node(dev, child) {
struct led_init_data init_data = {};
char default_label[32];
ret = fwnode_property_read_u32(child, "reg", ®);
if (ret || reg >= chipdef->n_leds) {
dev_err(dev, "Invalid 'reg' property for node %pfw\n",
child);
Reported by FlawFinder.