Merge "qcom: wdog: fix static analyzer reported issue in watchdog core"

This commit is contained in:
qctecmdr 2020-10-19 16:25:27 -07:00 • committed by Gerrit - the friendly Code Review server
commit 32ca277521

View file

@ -81,7 +81,7 @@ static struct qcom_irq_info *search(struct qcom_irq_info *key,
struct qcom_irq_info *base,
size_t num, compare_t cmp)
{
struct qcom_irq_info *pivot;
struct qcom_irq_info *pivot = NULL;
int result;
while (num > 0) {
@ -101,6 +101,10 @@ static struct qcom_irq_info *search(struct qcom_irq_info *key,
}
out:
if (pivot)
pr_debug("*pivot:%u key:%u\n",
pivot->total_count, key->total_count);
return pivot;
}
@ -184,9 +188,6 @@ static void compute_irq_stat(struct work_struct *work)
pos = search(&key, wdog_dd->irq_counts,
arr_size, cmp_irq_info_fn);
pr_debug("*pos:%u key:%u\n",
pos->total_count, key.total_count);
if (pos && (pos->total_count >= key.total_count)) {
if (pos < start)
pos++;