Skip to content

Commit 978ca99

Browse files
ethancedwards8Abhinav Kumar
authored andcommitted
drm/msm/dpu: Fix uninitialized variable
There is a possibility for an uninitialized *ret* variable to be returned in some code paths. Fix this by initializing *ret* to 0. Addresses-Coverity-ID: 1642546 ("Uninitialized scalar variable") Fixes: 774bcfb ("drm/msm/dpu: add support for virtual planes") Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/636201/ Link: https://lore.kernel.org/r/20250209-dpu-v2-1-114dfd4ebefd@ethancedwards.com Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
1 parent df9cf85 commit 978ca99

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,6 @@ int dpu_assign_plane_resources(struct dpu_global_state *global_state,
11641164
unsigned int num_planes)
11651165
{
11661166
unsigned int i;
1167-
int ret;
11681167

11691168
for (i = 0; i < num_planes; i++) {
11701169
struct drm_plane_state *plane_state = states[i];
@@ -1173,13 +1172,13 @@ int dpu_assign_plane_resources(struct dpu_global_state *global_state,
11731172
!plane_state->visible)
11741173
continue;
11751174

1176-
ret = dpu_plane_virtual_assign_resources(crtc, global_state,
1175+
int ret = dpu_plane_virtual_assign_resources(crtc, global_state,
11771176
state, plane_state);
11781177
if (ret)
1179-
break;
1178+
return ret;
11801179
}
11811180

1182-
return ret;
1181+
return 0;
11831182
}
11841183

11851184
static void dpu_plane_flush_csc(struct dpu_plane *pdpu, struct dpu_sw_pipe *pipe)

0 commit comments

Comments
 (0)