diff options
author | Will McVicker <willmcvicker@google.com> | 2022-09-09 17:13:41 +0000 |
---|---|---|
committer | Will McVicker <willmcvicker@google.com> | 2024-04-16 09:24:28 -0700 |
commit | ac0bf603a28c5b8bac4790633c453fdbb6437e5a (patch) | |
tree | 00c783e8576012b04ac4f30a8d92f631f2ead923 | |
parent | c89a5e25b355f0b2ee3cbb71c28b07f6b1a55de2 (diff) | |
download | sec_touch-android14-gs-pixel-6.1.tar.gz |
touch/sec: Check return value of kfifo_out_peak()android14-gs-pixel-6.1
This fixes a warning (and build error) caused by not checking the return
value.
Bug: 245773230
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I77d6dca92615cacf2591293d8d6d65e3afb1c017
-rw-r--r-- | sec_ts.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1877,14 +1877,19 @@ inline void sec_ts_hc_update_and_push(struct sec_ts_data *ts, struct sec_ts_heal inline void sec_ts_hc_dump(struct sec_ts_data *ts) { - int i; + int i, len; s64 delta; s64 sec_delta; u32 ms_delta; ktime_t current_time = ktime_get(); struct sec_ts_health_check last_hc[SEC_TS_HC_KFIFO_LEN]; - kfifo_out_peek(&hc_fifo, last_hc, kfifo_size(&hc_fifo)); + len = kfifo_out_peek(&hc_fifo, last_hc, kfifo_size(&hc_fifo)); + if (!len) { + input_err(true, &ts->client->dev, "%s: failed to peek hc\n", + __func__); + return; + } for (i = 0 ; i < ARRAY_SIZE(last_hc) ; i++) { sec_delta = 0; ms_delta = 0; |