]> git.baikalelectronics.ru Git - kernel.git/commit
parport_pc: fix find_superio io compare code, should use equal test.
authorQiaoChong <qiaochong@loongson.cn>
Sat, 9 Feb 2019 20:59:07 +0000 (20:59 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Feb 2019 08:39:02 +0000 (09:39 +0100)
commit74a5897e8fe941a2fb4be24c479f4d38339ea66e
tree668a40a887f0d9331074551545bb9026f3775e16
parent23528f1fe0cbe86daa6abff9c182412ea030086f
parport_pc: fix find_superio io compare code, should use equal test.

In the original code before 468c19a7bb2c the loop was continuing until
it finds the first matching superios[i].io and p->base.
But after 468c19a7bb2c the logic changed and the loop now returns the
pointer to the first mismatched array element which is then used in
get_superio_dma() and get_superio_irq() and thus returning the wrong
value.
Fix the condition so that it now returns the correct pointer.

Fixes: 468c19a7bb2c ("parport_pc: clean up the modified while loops using for")
Cc: Alan Cox <alan@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: QiaoChong <qiaochong@loongson.cn>
[rewrite the commit message]
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/parport/parport_pc.c