The following issues were found

drivers/gpu/drm/nouveau/nvkm/subdev/timer/priv.h
1 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 13 Column: 8 CWE codes: 120 20

              struct nvkm_timer_func {
	void (*init)(struct nvkm_timer *);
	void (*intr)(struct nvkm_timer *);
	u64 (*read)(struct nvkm_timer *);
	void (*time)(struct nvkm_timer *, u64 time);
	void (*alarm_init)(struct nvkm_timer *, u32 time);
	void (*alarm_fini)(struct nvkm_timer *);
};


            

Reported by FlawFinder.

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

Line: 191 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

              	u32  vendor_id;
	u32  device_id;
	u32  revision_id;
	char board_id[MTHCA_BOARD_ID_LEN];
	u8   inta_pin;
};

struct mthca_init_hca_param {
	u64 qpc_base;

            

Reported by FlawFinder.

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

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

              {
	struct etnaviv_iommuv1_context *v1_context = to_v1_context(context);

	memcpy(buf, v1_context->pgtable_cpu, PT_SIZE);
}

static void etnaviv_iommuv1_restore(struct etnaviv_gpu *gpu,
			     struct etnaviv_iommu_context *context)
{

            

Reported by FlawFinder.

drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c
1 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 65 Column: 20 CWE codes: 120 20

              u64
nvkm_timer_read(struct nvkm_timer *tmr)
{
	return tmr->func->read(tmr);
}

void
nvkm_timer_alarm_trigger(struct nvkm_timer *tmr)
{

            

Reported by FlawFinder.

drivers/infiniband/hw/mthca/mthca_eq.c
1 issues
snprintf - If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate
Security

Line: 838 Column: 3 CWE codes: 134
Suggestion: Use a constant for the format specification

              			dev->eq_table.eq[i].have_irq = 1;
		}
	} else {
		snprintf(dev->eq_table.eq[0].irq_name, IB_DEVICE_NAME_MAX,
			 DRV_NAME "@pci:%s", pci_name(dev->pdev));
		err = request_irq(dev->pdev->irq,
				  mthca_is_memfree(dev) ?
				  mthca_arbel_interrupt :
				  mthca_tavor_interrupt,

            

Reported by FlawFinder.

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

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

              			 etnaviv_chip_identities[i].customer_id == ~0U) &&
		    (etnaviv_chip_identities[i].eco_id == ident->eco_id ||
			 etnaviv_chip_identities[i].eco_id == ~0U)) {
			memcpy(ident, &etnaviv_chip_identities[i],
			       sizeof(*ident));
			return true;
		}
	}


            

Reported by FlawFinder.

drivers/infiniband/hw/mthca/mthca_main.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

              	mdev->eq_table.inta_pin = adapter.inta_pin;
	if (!mthca_is_memfree(mdev))
		mdev->rev_id = adapter.revision_id;
	memcpy(mdev->board_id, adapter.board_id, sizeof mdev->board_id);

	return 0;

err_close:
	mthca_close_hca(mdev);

            

Reported by FlawFinder.

drivers/gpu/drm/nouveau/nvkm/subdev/privring/gk20a.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: 61

              
	/* Acknowledge interrupt */
	nvkm_mask(device, 0x12004c, 0x2, 0x2);
	nvkm_msec(device, 2000,
		if (!(nvkm_rd32(device, 0x12004c) & 0x0000003f))
			break;
	);
}


            

Reported by Cppcheck.

drivers/gpu/drm/nouveau/nvkm/subdev/privring/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: 93

              	}

	nvkm_mask(device, 0x12004c, 0x0000003f, 0x00000002);
	nvkm_msec(device, 2000,
		if (!(nvkm_rd32(device, 0x12004c) & 0x0000003f))
			break;
	);
}


            

Reported by Cppcheck.

drivers/gpu/drm/nouveau/nvkm/subdev/privring/gf100.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: 93

              	}

	nvkm_mask(device, 0x121c4c, 0x0000003f, 0x00000002);
	nvkm_msec(device, 2000,
		if (!(nvkm_rd32(device, 0x121c4c) & 0x0000003f))
			break;
	);
}


            

Reported by Cppcheck.