The following issues were found
drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
1 issues
Line: 148
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
{
struct clk_init_data init;
struct sun8i_phy_clk *priv;
const char *parents[2];
parents[0] = __clk_get_name(phy->clk_pll0);
if (!parents[0])
return -ENODEV;
Reported by FlawFinder.
drivers/gpu/drm/sun4i/sun4i_tv.c
1 issues
Line: 491
Column: 3
CWE codes:
120
Suggestion:
Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)
return 0;
}
strcpy(mode->name, tv_mode->name);
sun4i_tv_mode_to_drm_mode(tv_mode, mode);
drm_mode_probed_add(connector, mode);
}
Reported by FlawFinder.
drivers/infiniband/hw/irdma/hmc.c
1 issues
Line: 598
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
page_desc = page->pa | 0x1;
pd_addr = pd_table->pd_page_addr.va;
pd_addr += rel_pd_idx;
memcpy(pd_addr, &page_desc, sizeof(*pd_addr));
pd_entry->sd_index = sd_idx;
pd_entry->valid = true;
pd_table->use_cnt++;
irdma_invalidate_pf_hmc_pd(dev, sd_idx, rel_pd_idx);
}
Reported by FlawFinder.
drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
1 issues
Line: 207
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
{
struct clk_init_data init;
struct sun4i_tmds *tmds;
const char *parents[2];
parents[0] = __clk_get_name(hdmi->pll0_clk);
if (!parents[0])
return -ENODEV;
Reported by FlawFinder.
drivers/infiniband/hw/irdma/i40iw_if.c
1 issues
Line: 188
Column: 2
CWE codes:
120
aux_dev);
struct i40e_info *cdev_info = i40e_adev->ldev;
strncpy(i40iw_client.name, "irdma", I40E_CLIENT_STR_LENGTH);
i40e_client_device_register(cdev_info, &i40iw_client);
return 0;
}
Reported by FlawFinder.
drivers/infiniband/hw/irdma/puda.c
1 issues
Line: 1210
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
void *mem1 = (u8 *)buf->mem.va + buf_offset;
void *mem2 = (u8 *)txbuf->mem.va + txbuf_offset;
memcpy(mem2, mem1, len);
}
/**
* irdma_ieq_setup_tx_buf - setup tx buffer for partial handling
* @buf: reeive buffer with partial
Reported by FlawFinder.
drivers/gpu/drm/sti/sti_hqvdp.c
1 issues
Line: 826
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
btm_cmd = hqvdp->hqvdp_cmd + btm_cmd_offset;
top_cmd = hqvdp->hqvdp_cmd + top_cmd_offest;
memcpy(btm_cmd, top_cmd, sizeof(*btm_cmd));
btm_cmd->top.config = TOP_CONFIG_INTER_BTM;
btm_cmd->top.current_luma +=
btm_cmd->top.luma_src_pitch / 2;
btm_cmd->top.current_chroma +=
Reported by FlawFinder.
drivers/infiniband/hw/irdma/type.h
1 issues
Line: 1260
Column: 53
CWE codes:
120
20
void irdma_sc_send_lsmm(struct irdma_sc_qp *qp, void *lsmm_buf, u32 size,
irdma_stag stag);
void irdma_sc_send_lsmm_nostag(struct irdma_sc_qp *qp, void *lsmm_buf, u32 size);
void irdma_sc_send_rtt(struct irdma_sc_qp *qp, bool read);
void irdma_sc_qp_setctx(struct irdma_sc_qp *qp, __le64 *qp_ctx,
struct irdma_qp_host_ctx_info *info);
void irdma_sc_qp_setctx_roce(struct irdma_sc_qp *qp, __le64 *qp_ctx,
struct irdma_qp_host_ctx_info *info);
enum irdma_status_code irdma_sc_cq_destroy(struct irdma_sc_cq *cq, u64 scratch,
Reported by FlawFinder.
drivers/gpu/drm/sti/sti_hda.c
1 issues
Line: 526
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
DRM_DEBUG_DRIVER("\n");
memcpy(&hda->mode, mode, sizeof(struct drm_display_mode));
if (!hda_get_mode_idx(hda->mode, &mode_idx)) {
DRM_ERROR("Undefined mode\n");
return;
}
Reported by FlawFinder.
drivers/gpu/drm/sti/sti_dvo.c
1 issues
Line: 291
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
DRM_DEBUG_DRIVER("\n");
memcpy(&dvo->mode, mode, sizeof(struct drm_display_mode));
/* According to the path used (main or aux), the dvo clocks should
* have a different parent clock. */
if (mixer->id == STI_MIXER_MAIN)
clkp = dvo->clk_main_parent;
Reported by FlawFinder.