google_battery: handle gdf > 100 in ssoc_change_curve()

SSOC: l=100% gdf=100.02 uic=100.00 rl=100.00 ct=-1 curve:[15.00 15.00][96.99 100.00][100.00 100.00] rls=1 bd_cnt=1
SSOC: l=100% gdf=100.02 uic=100.00 rl=100.00 ct=-1 curve:[15.00 15.00][95.00 100.00][100.00 100.00] rls=-1 bd_cnt=1

[96.99 100.00] should change to [100.00 100.00] instead of [95.00 100.00].

Bug: 187133830
Change-Id: I7c3364be702002cd2aaa1a2042c645807228b824
Signed-off-by: Ken Tsou <kentsou@google.com>
diff --git a/drivers/power/supply/google/google_battery.c b/drivers/power/supply/google/google_battery.c
index bee7767..d9463ab 100644
--- a/drivers/power/supply/google/google_battery.c
+++ b/drivers/power/supply/google/google_battery.c
@@ -786,6 +786,10 @@
 		gdf -=  delta;
 	}
 
+	/* adjust gdf to update curve[1].real in ssoc_uicurve_splice() */
+	if (gdf > ssoc_point_full)
+		gdf = ssoc_point_full;
+
 	ssoc_change_curve_at_gdf(ssoc_state, gdf,
 				 ssoc_get_capacity_raw(ssoc_state), type);
 }