diff options
-rw-r--r-- | drivers/input/touchscreen/ts_filter_group.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/ts_filter_group.c b/drivers/input/touchscreen/ts_filter_group.c index 80e6677d0cf..73e3625a5a6 100644 --- a/drivers/input/touchscreen/ts_filter_group.c +++ b/drivers/input/touchscreen/ts_filter_group.c @@ -182,8 +182,6 @@ static int ts_filter_group_process(struct ts_filter *tsf, int *coords) tsfg->range_max[n] = v[best_idx + best_size - 1]; } - BUG_ON(!tsf->next); - for (i = 0; i < tsfg->N; ++i) { int r; @@ -197,10 +195,14 @@ static int ts_filter_group_process(struct ts_filter *tsf, int *coords) if (n != tsfg->tsf.count_coords) /* sample not OK */ continue; - r = (tsf->next->api->process)(tsf->next, coords); - if (r) { - ret = r; - break; + if (tsf->next) { + r = (tsf->next->api->process)(tsf->next, coords); + if (r) { + ret = r; + break; + } + } else if (i == tsfg->N - 1) { + ret = 1; } } |