Эх сурвалжийг харах

disp: msm: sde: add buffer size checks

Add buffer size checks to improve code quality.

Change-Id: I99c64d6157d7b0475b0b28e093ea70820981fddd
Signed-off-by: Yu Wu <[email protected]>
Yu Wu 2 жил өмнө
parent
commit
bb70fda262

+ 1 - 1
msm/sde/sde_crtc.c

@@ -4072,7 +4072,7 @@ static bool _sde_crtc_wait_for_fences(struct drm_crtc *crtc)
 		MAX_HW_FENCES);
 		MAX_HW_FENCES);
 
 
 	/* register the hw-fences for hw-wait */
 	/* register the hw-fences for hw-wait */
-	if (num_hw_fences) {
+	if (num_hw_fences > 0 && num_hw_fences <= MAX_HW_FENCES) {
 
 
 		ret = sde_fence_register_hw_fences_wait(hw_ctl, dma_hw_fences, num_hw_fences);
 		ret = sde_fence_register_hw_fences_wait(hw_ctl, dma_hw_fences, num_hw_fences);
 		if (ret) {
 		if (ret) {