Commit a8f97647 authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher
Browse files

drm/amd/display: Bunch of smatch error and warning fixes in DC



drivers/gpu/drm/amd/amdgpu/../display/dc/basics/log_helpers.c:79
dc_conn_log() error: buffer overflow 'signal_type_info_tbl' 10 <= 10
drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:266
bios_parser_get_dst_obj() error: uninitialized symbol 'id'.
drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_audio.c:357
dce_aud_az_enable() warn: inconsistent indenting
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_resource.c:958
dcn10_acquire_idle_pipe_for_layer() error: we previously assumed
'head_pipe' could be null (see line 952)

Signed-off-by: default avatarHarry Wentland <harry.wentland@amd.com>
Reviewed-by: default avatarSun peng Li <Sunpeng.Li@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 70e8ffc5
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@ void dc_conn_log(struct dc_context *ctx,
		if (signal == signal_type_info_tbl[i].type)
			break;

	if (i == NUM_ELEMENTS(signal_type_info_tbl))
		goto fail;

	dm_logger_append(&entry, "[%s][ConnIdx:%d] ",
			signal_type_info_tbl[i].name,
			link->link_index);
@@ -96,6 +99,8 @@ void dc_conn_log(struct dc_context *ctx,

	dm_logger_append(&entry, "^\n");
	dm_helpers_dc_conn_log(ctx, &entry, event);

fail:
	dm_logger_close(&entry);

	va_end(args);
+2 −2
Original line number Diff line number Diff line
@@ -249,7 +249,7 @@ static enum bp_result bios_parser_get_dst_obj(struct dc_bios *dcb,
	struct graphics_object_id *dest_object_id)
{
	uint32_t number;
	uint16_t *id;
	uint16_t *id = NULL;
	ATOM_OBJECT *object;
	struct bios_parser *bp = BP_FROM_DCB(dcb);

@@ -260,7 +260,7 @@ static enum bp_result bios_parser_get_dst_obj(struct dc_bios *dcb,

	number = get_dest_obj_list(bp, object, &id);

	if (number <= index)
	if (number <= index || !id)
		return BP_RESULT_BADINPUT;

	*dest_object_id = object_id_from_bios_object_id(id[index]);
+4 −2
Original line number Diff line number Diff line
@@ -912,11 +912,13 @@ static struct pipe_ctx *dcn10_acquire_idle_pipe_for_layer(
	struct pipe_ctx *head_pipe = resource_get_head_pipe_for_stream(res_ctx, stream);
	struct pipe_ctx *idle_pipe = find_idle_secondary_pipe(res_ctx, pool);

	if (!head_pipe)
	if (!head_pipe) {
		ASSERT(0);
		return NULL;
	}

	if (!idle_pipe)
		return false;
		return NULL;

	idle_pipe->stream = head_pipe->stream;
	idle_pipe->stream_res.tg = head_pipe->stream_res.tg;
+5 −5

File changed.

Contains only whitespace changes.