ibmvnic: Do not process reset during or after device removal
authorThomas Falcon <tlfalcon@linux.ibm.com>
Tue, 27 Aug 2019 16:10:04 +0000 (11:10 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Sep 2019 05:17:05 +0000 (07:17 +0200)
commit6cce2adae3e17e75109d9a1088f1b1bb69d778b1
tree894aadbfa77358d31485d4f1eda53cf7c475465f
parent080ca754f5dbc8cc65b69902a81c901708adaf53
ibmvnic: Do not process reset during or after device removal

[ Upstream commit 36f1031c51a2538e5558fb44c6d6b88f98d3c0f2 ]

Currently, the ibmvnic driver will not schedule device resets
if the device is being removed, but does not check the device
state before the reset is actually processed. This leads to a race
where a reset is scheduled with a valid device state but is
processed after the driver has been removed, resulting in an oops.

Fix this by checking the device state before processing a queued
reset event.

Reported-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
Tested-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/ibm/ibmvnic.c