s390/qeth: tolerate pre-filled RX buffer
authorJulian Wiedmann <jwi@linux.ibm.com>
Thu, 30 Jul 2020 15:01:18 +0000 (17:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:04 +0000 (08:24 +0200)
commitb2400fe7e1011c5f3dc2268e8382082465b1c8a2
tree7abb0de6ec849adb8963ee4d03d69d5cdcc2f9a4
parent4911d559e6f59252170bb831645bdc039a2edffc
s390/qeth: tolerate pre-filled RX buffer

[ Upstream commit eff73e16ee116f6eafa2be48fab42659a27cb453 ]

When preparing a buffer for RX refill, tolerate that it already has a
pool_entry attached. Otherwise we could easily leak such a pool_entry
when re-driving the RX refill after an error (from eg. do_qdio()).

This needs some minor adjustment in the code that drains RX buffer(s)
prior to RX refill and during teardown, so that ->pool_entry is NULLed
accordingly.

Fixes: 4a71df50047f ("qeth: new qeth device driver")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/net/qeth_core_main.c