diff options
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_i2c.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_i2c.c b/linux/drivers/media/dvb/dvb-core/dvb_i2c.c index 3f3c4592e..ce1e9705e 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_i2c.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_i2c.c @@ -64,14 +64,15 @@ static void try_attach_device (struct dvb_i2c_bus *i2c, struct dvb_i2c_device *dev) { if (dev->owner) { - if (try_module_get(dev->owner)) { - if (dev->attach (i2c) == 0) { - register_i2c_client (i2c, dev); - } else { - if (dev->owner) - module_put (dev->owner); - } - } + if (!try_module_get(dev->owner)) + return; + } + + if (dev->attach (i2c) == 0) { + register_i2c_client (i2c, dev); + } else { + if (dev->owner) + module_put (dev->owner); } } |