Fix error in pol_sort.
pol_sort could go into an infinite loop. The proof of this patch is left as a exercise for the reader :-) Reported-by: "Hawrylewicz Czarnowski, Przemyslaw" <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
1e2b276535
commit
37194990aa
4
policy.c
4
policy.c
|
@ -137,8 +137,8 @@ static void pol_sort(struct dev_policy **pol)
|
|||
if (p[next] == NULL ||
|
||||
(p[1-next] != NULL &&
|
||||
!(pol_lesseq(prev, p[1-next])
|
||||
^pol_lesseq(p[1-next], p[next])
|
||||
^pol_lesseq(p[next], prev)))
|
||||
^pol_lesseq(prev, p[next])
|
||||
^pol_lesseq(p[next], p[1-next])))
|
||||
)
|
||||
next = 1 - next;
|
||||
|
||||
|
|
Loading…
Reference in New Issue