drm/i915: fix error path in intel_setup_gmbus()

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 <linux@rasmusvillemoes.dk>
Fixes: f899fc64cd ("drm/i915: use GMBUS to manage i2c links")
Cc: stable@vger.kernel.org
Signed-off-by: Jani 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 2417c8c03f)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
Rasmus Villemoes 2016-02-09 21:11:13 +01:00 committed by Jani Nikula
parent 39748841a7
commit ed3f9fd1e8
1 changed files with 1 additions and 1 deletions

View 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;