Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d80409c authored by Ch Ganesh Kumar's avatar Ch Ganesh Kumar Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: Fix Gamma LUT bounds condition



Validate the Gamma correction feature with all bound condition.
This change corrects the Gamma LUT block bound condition.

Change-Id: I3fc460b6a6e2e76f7c07b649e1db1e01ce208476
Signed-off-by: default avatarCh Ganesh Kumar <chganesh@codeaurora.org>
parent 80f44b2f
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1337,10 +1337,10 @@ static int __from_user_pgc_lut_data_legacy(
		return -EFAULT;
		return -EFAULT;


	if (num_r_stages > GC_LUT_SEGMENTS || num_b_stages > GC_LUT_SEGMENTS
	if (num_r_stages > GC_LUT_SEGMENTS || num_b_stages > GC_LUT_SEGMENTS
	    || num_r_stages > GC_LUT_SEGMENTS || !num_r_stages || !num_b_stages
	    || num_g_stages > GC_LUT_SEGMENTS || !num_r_stages || !num_b_stages
	    || !num_g_stages) {
	    || !num_g_stages) {
		pr_err("invalid number of stages r_stages %d b_stages %d g_stages %d\n",
		pr_err("invalid number of stages r_stages %d b_stages %d g_stages %d\n",
		       num_r_stages, num_b_stages, num_r_stages);
		       num_r_stages, num_b_stages, num_g_stages);
		return -EFAULT;
		return -EFAULT;
	}
	}