Message ID | 370458fcfbbd452381ad0f8787293455@rohde-schwarz.com |
---|---|
State | Accepted |
Commit | 9a22b2812393d93d84358a760c347c21939029a6 |
Headers | show |
Series | [v2] padata: use integer wrap around to prevent deadlock on seq_nr overflow | expand |
diff --git a/kernel/padata.c b/kernel/padata.c index 53f4bc912712..222bccd0c96b 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -404,7 +404,8 @@ void padata_do_serial(struct padata_priv *padata) /* Sort in ascending order of sequence number. */ list_for_each_prev(pos, &reorder->list) { cur = list_entry(pos, struct padata_priv, list); - if (cur->seq_nr < padata->seq_nr) + /* Compare by difference to consider integer wrap around */ + if ((signed int)(cur->seq_nr - padata->seq_nr) < 0) break; } list_add(&padata->list, pos);