DM: compare unsigned numbers to avoid overflow.
compare the two unsigned numbers to avoid delta calculation overflow. It could happen during UOS warm root, which can trigger a "fake" interrupt storm. Tracked-On: #1476 Signed-off-by: Minggui Cao <minggui.cao@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
parent
d29937374a
commit
4228c81b3f
|
@ -121,6 +121,10 @@ static void *intr_storm_monitor_thread(void *arg)
|
||||||
if (hdr->buffer[i] != intr_cnt_buf[i])
|
if (hdr->buffer[i] != intr_cnt_buf[i])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* avoid delta overflow */
|
||||||
|
if (hdr->buffer[i + 1] < intr_cnt_buf[i + 1])
|
||||||
|
continue;
|
||||||
|
|
||||||
delta = hdr->buffer[i + 1] - intr_cnt_buf[i + 1];
|
delta = hdr->buffer[i + 1] - intr_cnt_buf[i + 1];
|
||||||
if (delta > INTR_STORM_THRESHOLD) {
|
if (delta > INTR_STORM_THRESHOLD) {
|
||||||
#ifdef INTR_MONITOR_DBG
|
#ifdef INTR_MONITOR_DBG
|
||||||
|
|
Loading…
Reference in New Issue