uninitialized variable in dcn10 code

Tom St Denis tom.stdenis at amd.com
Tue Nov 14 12:29:28 UTC 2017


Hi Harry,

At display/dc/dcn10/dcn10_hw_sequencer.c:2140

	if (num_planes > 0) {
		struct dc_stream_state *stream_for_cursor;

		program_all_pipe_in_tree(dc, top_pipe_to_program, context);

		for (i = 0; i < dc->res_pool->pipe_count; i++) {
			struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];

			if (stream == pipe_ctx->stream) {
				stream_for_cursor = pipe_ctx->stream;
				break;
			}
		}

		/* TODO: this is a hack w/a for switching from mpo to pipe split */
		if (stream_for_cursor->cursor_attributes.address.quad_part != 0) {
			struct dc_cursor_position position = { 0 };

			dc_stream_set_cursor_position(stream_for_cursor, &position);
			dc_stream_set_cursor_attributes(stream_for_cursor,
				&stream_for_cursor->cursor_attributes);
		}
	}

The variable "stream_for_cursor" could be used uninitialized in the TODO 
block.  The pointer should be probably initialized to NULL at the top.

Cheers,
Tom


More information about the amd-gfx mailing list