Commit 5602ed42 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Ben Hutchings

drm/i915: fix error path in intel_setup_gmbus()

commit ed3f9fd1 upstream.

This fails to undo the setup for pin==0; moreover, something
interesting happens if the setup failed already at pin==0.
Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Fixes: f899fc64 ("drm/i915: use GMBUS to manage i2c links")
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1455048677-19882-3-git-send-email-linux@rasmusvillemoes.dk
(cherry picked from commit 2417c8c0)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
[bwh: Backported to 3.2: index variable is i, not pin]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 1276251f
...@@ -410,7 +410,7 @@ int intel_setup_gmbus(struct drm_device *dev) ...@@ -410,7 +410,7 @@ int intel_setup_gmbus(struct drm_device *dev)
return 0; return 0;
err: err:
while (--i) { while (i--) {
struct intel_gmbus *bus = &dev_priv->gmbus[i]; struct intel_gmbus *bus = &dev_priv->gmbus[i];
i2c_del_adapter(&bus->adapter); i2c_del_adapter(&bus->adapter);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment