The following issues were found

drivers/infiniband/hw/mthca/mthca_provider.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 98 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                    nent;
	struct mthca_buf_list *page_list;
	struct mthca_mr        mr;
	char		       irq_name[IB_DEVICE_NAME_MAX];
};

struct mthca_av;

enum mthca_ah_type {

            

Reported by FlawFinder.

drivers/gpu/drm/i915/gt/intel_engine_types.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 293 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 drm_i915_private *i915;
	struct intel_gt *gt;
	struct intel_uncore *uncore;
	char name[INTEL_ENGINE_CS_MAX_NAME];

	enum intel_engine_id id;
	enum intel_engine_id legacy_idx;

	unsigned int hw_id;

            

Reported by FlawFinder.

drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 38 Column: 2 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              	if ((memx->c.size + size >= ARRAY_SIZE(memx->c.data)) ||
	    (memx->c.mthd && memx->c.mthd != mthd))
		memx_out(memx);
	memcpy(&memx->c.data[memx->c.size], data, size * sizeof(data[0]));
	memx->c.size += size;
	memx->c.mthd  = mthd;
}

int

            

Reported by FlawFinder.

drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gt215.c
1 issues
syntax error
Error

Line: 40

              	mutex_lock(&pmu->send.mutex);
	/* wait for a free slot in the fifo */
	addr  = nvkm_rd32(device, 0x10a4a0);
	if (nvkm_msec(device, 2000,
		u32 tmp = nvkm_rd32(device, 0x10a4b0);
		if (tmp != (addr ^ 8))
			break;
	) < 0) {
		mutex_unlock(&pmu->send.mutex);

            

Reported by Cppcheck.

drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk110.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If nvkm_msec is a macro then please configure it.
Error

Line: 70

              	nvkm_mask(device, 0x0206b4, 0x00000000, 0x00000000);
	for (i = 0; i < ARRAY_SIZE(magic); i++) {
		nvkm_wr32(device, magic[i].addr, magic[i].data);
		nvkm_msec(device, 2000,
			if (!(nvkm_rd32(device, magic[i].addr) & 0x80000000))
				break;
		);
	}


            

Reported by Cppcheck.

drivers/gpu/drm/i915/gt/gen7_renderclear.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 201 Column: 8 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              		      const u32 size)
{
	return batch_offset(state,
			    memcpy(batch_alloc_bytes(state, 64, size),
				   data, size));
}

static u32
gen7_fill_interface_descriptor(struct batch_chunk *state,

            

Reported by FlawFinder.

drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk104.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If nvkm_msec is a macro then please configure it.
Error

Line: 39

              	nvkm_wr32(device, 0x00c800, 0x00000000);
	nvkm_wr32(device, 0x00c808, 0x00000000);
	nvkm_wr32(device, 0x00c800, ctrl);
	nvkm_msec(device, 2000,
		if (nvkm_rd32(device, 0x00c800) & 0x40000000) {
			while (size--)
				nvkm_wr32(device, 0x00c804, 0x00000000);
			break;
		}

            

Reported by Cppcheck.

drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If nvkm_msec is a macro then please configure it.
Error

Line: 107

              
	/* Inhibit interrupts, and wait for idle. */
	nvkm_wr32(device, 0x10a014, 0x0000ffff);
	nvkm_msec(device, 2000,
		if (!nvkm_rd32(device, 0x10a04c))
			break;
	);

	/* Reset. */

            

Reported by Cppcheck.

drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If nvkm_msec is a macro then please configure it.
Error

Line: 43

              	nvkm_wr32(device, 0x100e68, 0x00000000);
	nvkm_wr32(device, 0xb830b0, 0x80000000 | type);

	nvkm_msec(device, 2000,
		if (!(nvkm_rd32(device, 0xb830b0) & 0x80000000))
			break;
	);

	mutex_unlock(&vmm->mmu->mutex);

            

Reported by Cppcheck.

drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c
1 issues
syntax error
Error

Line: 216

              		}

		nvkm_wr32(device, 0x100c80, (id << 16) | 1);
		if (nvkm_msec(device, 2000,
			if (!(nvkm_rd32(device, 0x100c80) & 0x00000001))
				break;
		) < 0)
			nvkm_error(subdev, "%s mmu invalidate timeout\n", nvkm_subdev_type[i]);
	}

            

Reported by Cppcheck.