The following issues were found

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c
1 issues
Uninitialized variable: wptr_val
Error

Line: 233 CWE codes: 908

              	valid_wptr = read_user_wptr(mm, wptr, wptr_val);
	acquire_queue(kgd, pipe_id, queue_id);
	if (valid_wptr)
		WREG32(mmCP_HQD_PQ_WPTR, (wptr_val << wptr_shift) & wptr_mask);

	data = REG_SET_FIELD(m->cp_hqd_active, CP_HQD_ACTIVE, ACTIVE, 1);
	WREG32(mmCP_HQD_ACTIVE, data);

	release_queue(kgd);

            

Reported by Cppcheck.

drivers/accessibility/speakup/speakup_ltlk.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 131 Column: 11 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 void synth_interrogate(struct spk_synth *synth)
{
	unsigned char *t, i;
	unsigned char buf[50], rom_v[20];

	synth->synth_immediate(synth, "\x18\x01?");
	for (i = 0; i < 50; i++) {
		buf[i] = synth->io_ops->synth_in(synth);
		if (i > 2 && buf[i] == 0x7f)

            

Reported by FlawFinder.

drivers/accessibility/speakup/speakup_dtlk.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 276 Column: 9 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 struct synth_settings *synth_interrogate(struct spk_synth *synth)
{
	u_char *t;
	static char buf[sizeof(struct synth_settings) + 1];
	int total, i;
	static struct synth_settings status;

	synth_immediate(synth, "\x18\x01?");
	for (total = 0, i = 0; i < 50; i++) {

            

Reported by FlawFinder.

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

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

              			kptr += va_start - offset;

			if (ring->funcs->parse_cs) {
				memcpy(ib->ptr, kptr, chunk_ib->ib_bytes);
				amdgpu_bo_kunmap(aobj);

				r = amdgpu_ring_parse_cs(ring, p, j);
				if (r)
					return r;

            

Reported by FlawFinder.

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 35 Column: 14 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

              #define mmMM_DATA		0x1
#define HW_ID_MAX		300

static const char *hw_id_names[HW_ID_MAX] = {
	[MP1_HWID]		= "MP1",
	[MP2_HWID]		= "MP2",
	[THM_HWID]		= "THM",
	[SMUIO_HWID]		= "SMUIO",
	[FUSE_HWID]		= "FUSE",

            

Reported by FlawFinder.

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 116 Column: 1 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 amdgpu_hw_i2c;
int amdgpu_pcie_gen2 = -1;
int amdgpu_msi = -1;
char amdgpu_lockup_timeout[AMDGPU_MAX_TIMEOUT_PARAM_LENGTH];
int amdgpu_dpm = -1;
int amdgpu_fw_load_type = -1;
int amdgpu_aspm = -1;
int amdgpu_runtime_pm = -1;
uint amdgpu_ip_block_mask = 0xffffffff;

            

Reported by FlawFinder.

drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 43 Column: 14 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

              #include "amdgpu_fdinfo.h"


static const char *amdgpu_ip_name[AMDGPU_HW_IP_NUM] = {
	[AMDGPU_HW_IP_GFX]	=	"gfx",
	[AMDGPU_HW_IP_COMPUTE]	=	"compute",
	[AMDGPU_HW_IP_DMA]	=	"dma",
	[AMDGPU_HW_IP_UVD]	=	"dec",
	[AMDGPU_HW_IP_VCE]	=	"enc",

            

Reported by FlawFinder.

drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c
1 issues
strcpy - Does not check for buffer overflows when copying to destination [MS-banned]
Security

Line: 44 Column: 3 CWE codes: 120
Suggestion: Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)

              		adev->hdp.ras_if->block = AMDGPU_RAS_BLOCK__HDP;
		adev->hdp.ras_if->type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE;
		adev->hdp.ras_if->sub_block_index = 0;
		strcpy(adev->hdp.ras_if->name, "hdp");
	}
	ih_info.head = fs_info.head = *adev->hdp.ras_if;
	r = amdgpu_ras_late_init(adev, adev->hdp.ras_if,
				 &fs_info, &ih_info);
	if (r || !amdgpu_ras_is_supported(adev, adev->hdp.ras_if->block)) {

            

Reported by FlawFinder.

drivers/accessibility/speakup/speakup_audptr.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

              static void synth_version(struct spk_synth *synth)
{
	unsigned char test = 0;
	char synth_id[40] = "";

	synth->synth_immediate(synth, "\x05[Q]");
	synth_id[test] = synth->io_ops->synth_in(synth);
	if (synth_id[test] == 'A') {
		do {

            

Reported by FlawFinder.

drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c
1 issues
strcpy - Does not check for buffer overflows when copying to destination [MS-banned]
Security

Line: 44 Column: 3 CWE codes: 120
Suggestion: Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)

              		adev->mmhub.ras_if->block = AMDGPU_RAS_BLOCK__MMHUB;
		adev->mmhub.ras_if->type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE;
		adev->mmhub.ras_if->sub_block_index = 0;
		strcpy(adev->mmhub.ras_if->name, "mmhub");
	}
	ih_info.head = fs_info.head = *adev->mmhub.ras_if;
	r = amdgpu_ras_late_init(adev, adev->mmhub.ras_if,
				 &fs_info, &ih_info);
	if (r || !amdgpu_ras_is_supported(adev, adev->mmhub.ras_if->block)) {

            

Reported by FlawFinder.