]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] em28xx: unregister i2c bus 0 if bus 1 fails to register
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 5 Jan 2014 11:43:40 +0000 (08:43 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 7 Jan 2014 07:07:36 +0000 (05:07 -0200)
Fix the error handling logic, making it to unregister i2c bus 0, in
case of a failure to register the second bus.

Reported-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/usb/em28xx/em28xx-cards.c

index 541de6df127b7e5255dcea2b0c9100cab697c92b..dbce4dc421f95034357b0d2fd112a0eb835293f4 100644 (file)
@@ -2989,6 +2989,9 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
                if (retval < 0) {
                        em28xx_errdev("%s: em28xx_i2c_register bus 1 - error [%d]!\n",
                                __func__, retval);
+
+                       em28xx_i2c_unregister(dev, 0);
+
                        return retval;
                }
        }