Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f0ee65a authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] em28xx: unregister i2c bus 0 if bus 1 fails to register



Fix the error handling logic, making it to unregister i2c bus 0, in
case of a failure to register the second bus.

Reported-by: default avatarFrank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent b64f8e9a
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -2989,6 +2989,9 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
		if (retval < 0) {
		if (retval < 0) {
			em28xx_errdev("%s: em28xx_i2c_register bus 1 - error [%d]!\n",
			em28xx_errdev("%s: em28xx_i2c_register bus 1 - error [%d]!\n",
				__func__, retval);
				__func__, retval);

			em28xx_i2c_unregister(dev, 0);

			return retval;
			return retval;
		}
		}
	}
	}