The following issues were found
drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
1 issues
Line: 695
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
goto err;
}
memcpy(hwmgr->hardcode_pp_table, buf, size);
hwmgr->soft_pp_table = hwmgr->hardcode_pp_table;
ret = amd_powerplay_reset(handle);
if (ret)
Reported by FlawFinder.
crypto/hash_info.c
1 issues
Line: 11
Column: 7
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 <linux/export.h>
#include <crypto/hash_info.h>
const char *const hash_algo_name[HASH_ALGO__LAST] = {
[HASH_ALGO_MD4] = "md4",
[HASH_ALGO_MD5] = "md5",
[HASH_ALGO_SHA1] = "sha1",
[HASH_ALGO_RIPE_MD_160] = "rmd160",
[HASH_ALGO_SHA256] = "sha256",
Reported by FlawFinder.
drivers/gpu/drm/amd/pm/powerplay/hwmgr/pppcielanes.c
1 issues
Line: 54
Column: 23
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
6 /* 16 Lanes */
};
static const unsigned char pp_r600_decoded_lanes[8] = { 16, 1, 2, 4, 8, 12, 16, };
uint8_t encode_pcie_lane_width(uint32_t num_lanes)
{
return pp_r600_encode_lanes[num_lanes];
}
Reported by FlawFinder.
drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c
1 issues
Line: 772
if (pp_table_information->vdd_dep_on_sclk->count <
atom_gpio_table->ucVRHotTriggeredSclkDpmIndex)
PP_ASSERT_WITH_CODE(false,
"SCLK DPM index for VRHot cannot exceed the total sclk level count!",);
else
pp_gpio_table->vrhot_triggered_sclk_dpm_index =
atom_gpio_table->ucVRHotTriggeredSclkDpmIndex;
*pp_tonga_gpio_table = pp_gpio_table;
Reported by Cppcheck.
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c
1 issues
Line: 242
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
}
memcpy(vol_table, table, sizeof(struct pp_atomctrl_voltage_table));
kfree(table);
table = NULL;
return 0;
}
Reported by FlawFinder.
drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
1 issues
Line: 508
(uint16_t)(cac_dtp_table->usTDP * 128));
PP_ASSERT_WITH_CODE(cac_dtp_table->usTargetOperatingTemp <= 255,
"Target Operating Temp is out of Range!",
);
dpm_table->GpuTjMax = (uint8_t)(cac_dtp_table->usTargetOperatingTemp);
dpm_table->GpuTjHyst = 8;
Reported by Cppcheck.
drivers/block/drbd/drbd_req.c
1 issues
Line: 513
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 void drbd_report_io_error(struct drbd_device *device, struct drbd_request *req)
{
char b[BDEVNAME_SIZE];
if (!__ratelimit(&drbd_ratelimit_state))
return;
drbd_warn(device, "local %s IO error sector %llu+%u on %s\n",
Reported by FlawFinder.
drivers/block/drbd/drbd_vli.h
1 issues
Line: 304
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* n may be at most 9, if cur.bit + bits > 64 */
/* which means this copies at most 8 byte */
if (n) {
memcpy(&val, bs->cur.b+1, n - 1);
val = le64_to_cpu(val) << (8 - bs->cur.bit);
}
/* we still need the low bits */
val |= bs->cur.b[0] >> bs->cur.bit;
Reported by FlawFinder.
drivers/block/drbd/drbd_bitmap.c
1 issues
Line: 1037
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 drbd_bitmap *b = device->bitmap;
unsigned int num_pages, i, count = 0;
unsigned long now;
char ppb[10];
int err = 0;
/*
* We are protected against bitmap disappearing/resizing by holding an
* ldev reference (caller must have called get_ldev()).
Reported by FlawFinder.
drivers/block/ataflop.c
1 issues
Line: 1979
Column: 2
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
disk->major = FLOPPY_MAJOR;
disk->first_minor = drive + (type << 2);
disk->minors = 1;
sprintf(disk->disk_name, "fd%d", drive);
disk->fops = &floppy_fops;
disk->events = DISK_EVENT_MEDIA_CHANGE;
disk->private_data = &unit[drive];
set_capacity(disk, MAX_DISK_SIZE * 2);
Reported by FlawFinder.