Skip to content

Commit ba3193f

Browse files
Alex Hungalexdeucher
authored andcommitted
drm/amd/display: Fix uninitialized variables in DC
This fixes 49 UNINIT issues reported by Coverity. Reviewed-by: Hersen Wu <[email protected]> Acked-by: Wayne Lin <[email protected]> Signed-off-by: Alex Hung <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent f95bcb0 commit ba3193f

File tree

18 files changed

+39
-39
lines changed

18 files changed

+39
-39
lines changed

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,7 @@ static void disable_vbios_mode_if_required(
13061306

13071307
if (link != NULL && link->link_enc->funcs->is_dig_enabled(link->link_enc)) {
13081308
unsigned int enc_inst, tg_inst = 0;
1309-
unsigned int pix_clk_100hz;
1309+
unsigned int pix_clk_100hz = 0;
13101310

13111311
enc_inst = link->link_enc->funcs->get_dig_frontend(link->link_enc);
13121312
if (enc_inst != ENGINE_ID_UNKNOWN) {
@@ -1793,7 +1793,7 @@ bool dc_validate_boot_timing(const struct dc *dc,
17931793
return false;
17941794

17951795
if (dc_is_dp_signal(link->connector_signal)) {
1796-
unsigned int pix_clk_100hz;
1796+
unsigned int pix_clk_100hz = 0;
17971797
uint32_t numOdmPipes = 1;
17981798
uint32_t id_src[4] = {0};
17991799

drivers/gpu/drm/amd/display/dc/core/dc_resource.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3042,7 +3042,7 @@ bool resource_update_pipes_for_plane_with_slice_count(
30423042
int i;
30433043
int dpp_pipe_count;
30443044
int cur_slice_count;
3045-
struct pipe_ctx *dpp_pipes[MAX_PIPES];
3045+
struct pipe_ctx *dpp_pipes[MAX_PIPES] = {0};
30463046
bool result = true;
30473047

30483048
dpp_pipe_count = resource_get_dpp_pipes_for_plane(plane,

drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ void mpc3_get_gamut_remap(struct mpc *mpc,
11831183
struct mpc_grph_gamut_adjustment *adjust)
11841184
{
11851185
struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
1186-
uint16_t arr_reg_val[12];
1186+
uint16_t arr_reg_val[12] = {0};
11871187
int select;
11881188

11891189
read_gamut_remap(mpc30, mpcc_id, arr_reg_val, &select);

drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ static unsigned int get_source_mpc_factor(const struct dml2_context *ctx,
864864
struct dc_state *state,
865865
const struct dc_plane_state *plane)
866866
{
867-
struct pipe_ctx *dpp_pipes[MAX_PIPES];
867+
struct pipe_ctx *dpp_pipes[MAX_PIPES] = {0};
868868
int dpp_pipe_count = ctx->config.callbacks.get_dpp_pipes_for_plane(plane,
869869
&state->res_ctx, dpp_pipes);
870870

drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void dpp1_cm_get_gamut_remap(struct dpp *dpp_base,
234234
struct dpp_grph_csc_adjustment *adjust)
235235
{
236236
struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
237-
uint16_t arr_reg_val[12];
237+
uint16_t arr_reg_val[12] = {0};
238238
enum gamut_remap_select select;
239239

240240
read_gamut_remap(dpp, arr_reg_val, &select);

drivers/gpu/drm/amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ void dpp2_cm_get_gamut_remap(struct dpp *dpp_base,
274274
struct dpp_grph_csc_adjustment *adjust)
275275
{
276276
struct dcn20_dpp *dpp = TO_DCN20_DPP(dpp_base);
277-
uint16_t arr_reg_val[12];
277+
uint16_t arr_reg_val[12] = {0};
278278
enum dcn20_gamut_remap_select select;
279279

280280
read_gamut_remap(dpp, arr_reg_val, &select);

drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ void dpp3_cm_get_gamut_remap(struct dpp *dpp_base,
445445
struct dpp_grph_csc_adjustment *adjust)
446446
{
447447
struct dcn3_dpp *dpp = TO_DCN30_DPP(dpp_base);
448-
uint16_t arr_reg_val[12];
448+
uint16_t arr_reg_val[12] = {0};
449449
int select;
450450

451451
read_gamut_remap(dpp, arr_reg_val, &select);

drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ struct gpio *dal_gpio_service_create_irq(
128128
uint32_t offset,
129129
uint32_t mask)
130130
{
131-
enum gpio_id id;
131+
enum gpio_id id = 0;
132132
uint32_t en;
133133

134134
if (!service->translate.funcs->offset_to_id(offset, mask, &id, &en)) {
@@ -144,7 +144,7 @@ struct gpio *dal_gpio_service_create_generic_mux(
144144
uint32_t offset,
145145
uint32_t mask)
146146
{
147-
enum gpio_id id;
147+
enum gpio_id id = 0;
148148
uint32_t en;
149149
struct gpio *generic;
150150

@@ -178,7 +178,7 @@ struct gpio_pin_info dal_gpio_get_generic_pin_info(
178178
enum gpio_id id,
179179
uint32_t en)
180180
{
181-
struct gpio_pin_info pin;
181+
struct gpio_pin_info pin = {0};
182182

183183
if (service->translate.funcs->id_to_offset) {
184184
service->translate.funcs->id_to_offset(id, en, &pin);

drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ enum dc_status dce110_apply_single_controller_ctx_to_hw(
15371537
}
15381538

15391539
if (pipe_ctx->stream_res.audio != NULL) {
1540-
struct audio_output audio_output;
1540+
struct audio_output audio_output = {0};
15411541

15421542
build_audio_output(context, pipe_ctx, &audio_output);
15431543

@@ -2260,7 +2260,7 @@ static void dce110_setup_audio_dto(
22602260
continue;
22612261

22622262
if (pipe_ctx->stream_res.audio != NULL) {
2263-
struct audio_output audio_output;
2263+
struct audio_output audio_output = {0};
22642264

22652265
build_audio_output(context, pipe_ctx, &audio_output);
22662266

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@ static int dcn10_align_pixel_clocks(struct dc *dc, int group_size,
21852185
struct dc_crtc_timing *hw_crtc_timing;
21862186
uint64_t phase[MAX_PIPES];
21872187
uint64_t modulo[MAX_PIPES];
2188-
unsigned int pclk;
2188+
unsigned int pclk = 0;
21892189

21902190
uint32_t embedded_pix_clk_100hz;
21912191
uint16_t embedded_h_total;
@@ -2276,7 +2276,7 @@ void dcn10_enable_vblanks_synchronization(
22762276
struct dc_context *dc_ctx = dc->ctx;
22772277
struct output_pixel_processor *opp;
22782278
struct timing_generator *tg;
2279-
int i, width, height, master;
2279+
int i, width = 0, height = 0, master;
22802280

22812281
DC_LOGGER_INIT(dc_ctx->logger);
22822282

@@ -2342,7 +2342,7 @@ void dcn10_enable_timing_synchronization(
23422342
struct dc_context *dc_ctx = dc->ctx;
23432343
struct output_pixel_processor *opp;
23442344
struct timing_generator *tg;
2345-
int i, width, height;
2345+
int i, width = 0, height = 0;
23462346

23472347
DC_LOGGER_INIT(dc_ctx->logger);
23482348

0 commit comments

Comments
 (0)