drm/i915: fix error path in intel_setup_gmbus()
authorRasmus Villemoes <[email protected]>
Tue, 9 Feb 2016 20:11:13 +0000 (21:11 +0100)
committerJani Nikula <[email protected]>
Wed, 10 Feb 2016 08:53:29 +0000 (10:53 +0200)
This fails to undo the setup for pin==0; moreover, something
interesting happens if the setup failed already at pin==0.

Signed-off-by: Rasmus Villemoes <[email protected]>
Fixes: f899fc64cda8 ("drm/i915: use GMBUS to manage i2c links")
Cc: [email protected]
Signed-off-by: Jani Nikula <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/i915/intel_i2c.c

index 25254b5c1ac5c95173d0d5b4fa101f35a1131cb7..deb8282c26d83f952473ae145c4fef0b3112b9f1 100644 (file)
@@ -683,7 +683,7 @@ int intel_setup_gmbus(struct drm_device *dev)
        return 0;
 
 err:
-       while (--pin) {
+       while (pin--) {
                if (!intel_gmbus_is_valid_pin(dev_priv, pin))
                        continue;