The following issues were found
drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c
1 issues
Line: 119
Column: 23
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
return -EINVAL;
}
switch (dmaobj->base.access) {
case NV_MEM_ACCESS_RO:
dmaobj->flags0 |= 0x00004000;
break;
case NV_MEM_ACCESS_WO:
dmaobj->flags0 |= 0x00008000;
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/engine/dma/usergf100.c
1 issues
Line: 137
Column: 23
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
return -EINVAL;
}
switch (dmaobj->base.access) {
case NV_MEM_ACCESS_VM:
break;
case NV_MEM_ACCESS_RO:
dmaobj->flags0 |= 0x00040000;
break;
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/engine/disp/tu102.c
1 issues
Line: 42
/* Claim ownership of display. */
if (nvkm_rd32(device, 0x6254e8) & 0x00000002) {
nvkm_mask(device, 0x6254e8, 0x00000001, 0x00000000);
if (nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x6254e8) & 0x00000002))
break;
) < 0)
return -EBUSY;
}
Reported by Cppcheck.
drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c
1 issues
Line: 40
static void
nv50_sor_power_wait(struct nvkm_device *device, u32 soff)
{
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x61c004 + soff) & 0x80000000))
break;
);
}
Reported by Cppcheck.
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgv100.c
1 issues
Line: 51
const u32 data = 0x80000000 | (0x00000001 * enable);
const u32 mask = 0x8000000d;
nvkm_mask(device, 0x616560 + hoff, mask, data);
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x616560 + hoff) & 0x80000000))
break;
);
}
Reported by Cppcheck.
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgt215.c
1 issues
Line: 34
const u32 data = 0x80000000 | (0x00000001 * enable);
const u32 mask = 0x8000000d;
nvkm_mask(device, 0x61c1e0 + soff, mask, data);
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x61c1e0 + soff) & 0x80000000))
break;
);
}
Reported by Cppcheck.
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c
1 issues
Line: 53
const u32 data = 0x80000000 | (0x00000001 * enable);
const u32 mask = 0x8000000d;
nvkm_mask(device, 0x616618 + hoff, mask, data);
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x616618 + hoff) & 0x80000000))
break;
);
}
Reported by Cppcheck.
drivers/input/joystick/amijoy.c
1 issues
Line: 36
Column: 8
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 amijoy_used;
static DEFINE_MUTEX(amijoy_mutex);
static struct input_dev *amijoy_dev[2];
static char *amijoy_phys[2] = { "amijoy/input0", "amijoy/input1" };
static irqreturn_t amijoy_interrupt(int irq, void *dummy)
{
int i, data = 0, button = 0;
Reported by FlawFinder.
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c
1 issues
Line: 96
nvkm_mask(device, 0x61c130 + loff, 0x0000000f, mask);
nvkm_mask(device, 0x61c034 + soff, 0x80000000, 0x80000000);
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x61c034 + soff) & 0x80000000))
break;
);
}
Reported by Cppcheck.
drivers/input/joystick/cobra.c
1 issues
Line: 37
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;
int bads;
unsigned char exists;
char phys[2][32];
};
static unsigned char cobra_read_packet(struct gameport *gameport, unsigned int *data)
{
unsigned long flags;
Reported by FlawFinder.