Demod I2C client should be NULL after demod is unregistered on error path, otherwise it will be unregistered again when driver is unload. Signed-off-by: Antti Palosaari <crope@xxxxxx> --- drivers/media/pci/cx23885/cx23885-dvb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c index c47d182..6bb7935 100644 --- a/drivers/media/pci/cx23885/cx23885-dvb.c +++ b/drivers/media/pci/cx23885/cx23885-dvb.c @@ -1793,12 +1793,14 @@ static int dvb_register(struct cx23885_tsport *port) client_tuner->dev.driver == NULL) { module_put(client_demod->dev.driver->owner); i2c_unregister_device(client_demod); + port->i2c_client_demod = NULL; goto frontend_detach; } if (!try_module_get(client_tuner->dev.driver->owner)) { i2c_unregister_device(client_tuner); module_put(client_demod->dev.driver->owner); i2c_unregister_device(client_demod); + port->i2c_client_demod = NULL; goto frontend_detach; } port->i2c_client_tuner = client_tuner; @@ -1843,12 +1845,14 @@ static int dvb_register(struct cx23885_tsport *port) client_tuner->dev.driver == NULL) { module_put(client_demod->dev.driver->owner); i2c_unregister_device(client_demod); + port->i2c_client_demod = NULL; goto frontend_detach; } if (!try_module_get(client_tuner->dev.driver->owner)) { i2c_unregister_device(client_tuner); module_put(client_demod->dev.driver->owner); i2c_unregister_device(client_demod); + port->i2c_client_demod = NULL; goto frontend_detach; } port->i2c_client_tuner = client_tuner; @@ -1989,6 +1993,7 @@ static int dvb_register(struct cx23885_tsport *port) client_tuner->dev.driver == NULL) { module_put(client_demod->dev.driver->owner); i2c_unregister_device(client_demod); + port->i2c_client_demod = NULL; goto frontend_detach; } if (!try_module_get(client_tuner->dev.driver->owner)) { -- http://palosaari.fi/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html