Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932440AbcCBAXg (ORCPT ); Tue, 1 Mar 2016 19:23:36 -0500 Received: from mail333.us4.mandrillapp.com ([205.201.137.77]:58676 "EHLO mail333.us4.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932294AbcCAX5r (ORCPT ); Tue, 1 Mar 2016 18:57:47 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=linuxfoundation.org; b=og2HjFtj8aEfglV6nhMEYm9XeyiWtQkRQDHjm+U9Wf9ok9pq9moIlTkSUPnXm546XlXrXBla1Yk7 YUx7JOr/MWjWbj/blVVqPBMq8ufkxaAT7Yy+tR/PbHOFuGtnresmz/Vy9vu9Duwps/dJlhuc9BFj EgbZMfvkJ8GNgqQpcXw=; From: Greg Kroah-Hartman Subject: [PATCH 4.4 226/342] drm/i915: fix error path in intel_setup_gmbus() X-Mailer: git-send-email 2.7.2 To: Cc: Greg Kroah-Hartman , , Rasmus Villemoes , Jani Nikula Message-Id: <20160301234535.233835791@linuxfoundation.org> In-Reply-To: <20160301234527.990448862@linuxfoundation.org> References: <20160301234527.990448862@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.104c56faf3f146bf9c014d6bc482da42 X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:55:12 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1149 Lines: 33 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rasmus Villemoes commit ed3f9fd1e865975ceefdb2a43b453e090b1fd787 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: Rasmus Villemoes Fixes: f899fc64cda8 ("drm/i915: use GMBUS to manage i2c links") Signed-off-by: Jani Nikula Link: http://patchwork.freedesktop.org/patch/msgid/1455048677-19882-3-git-send-email-linux@rasmusvillemoes.dk (cherry picked from commit 2417c8c03f508841b85bf61acc91836b7b0e2560) Signed-off-by: Jani Nikula Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/intel_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/i915/intel_i2c.c +++ b/drivers/gpu/drm/i915/intel_i2c.c @@ -675,7 +675,7 @@ int intel_setup_gmbus(struct drm_device return 0; err: - while (--pin) { + while (pin--) { if (!intel_gmbus_is_valid_pin(dev_priv, pin)) continue;