]> git.baikalelectronics.ru Git - kernel.git/commit
ibmvnic: device remove has higher precedence over reset
authorLijun Pan <ljp@linux.ibm.com>
Fri, 29 Jan 2021 04:34:01 +0000 (22:34 -0600)
committerJakub Kicinski <kuba@kernel.org>
Tue, 2 Feb 2021 02:32:29 +0000 (18:32 -0800)
commitd7f343598c11ab90fd68d04994f9c2e29a70fbd0
tree124ea19f1859c80b6869bea63efd45ffd66aa6c1
parentd7592da396d6aa8512e85608ea3754af2de3d87a
ibmvnic: device remove has higher precedence over reset

Returning -EBUSY in ibmvnic_remove() does not actually hold the
removal procedure since driver core doesn't care for the return
value (see __device_release_driver() in drivers/base/dd.c
calling dev->bus->remove()) though vio_bus_remove
(in arch/powerpc/platforms/pseries/vio.c) records the
return value and passes it on. [1]

During the device removal precedure, checking for resetting
bit is dropped so that we can continue executing all the
cleanup calls in the rest of the remove function. Otherwise,
it can cause latent memory leaks and kernel crashes.

[1] https://lore.kernel.org/linuxppc-dev/20210117101242.dpwayq6wdgfdzirl@pengutronix.de/T/#m48f5befd96bc9842ece2a3ad14f4c27747206a53
Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fixes: 76c528960bab ("ibmvnic: Do not process device remove during device reset")
Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
Link: https://lore.kernel.org/r/20210129043402.95744-1-ljp@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ibm/ibmvnic.c