diff mbox

[2/5] drm/i915: fix error path in intel_setup_gmbus()

Message ID 1455048677-19882-3-git-send-email-linux@rasmusvillemoes.dk (mailing list archive)
State New, archived
Headers show

Commit Message

Rasmus Villemoes Feb. 9, 2016, 8:11 p.m. UTC
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>
---
 drivers/gpu/drm/i915/intel_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jani Nikula Feb. 9, 2016, 8:27 p.m. UTC | #1
On Tue, 09 Feb 2016, Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:
> 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>
> ---
>  drivers/gpu/drm/i915/intel_i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
> index 25254b5c1ac5..deb8282c26d8 100644
> --- a/drivers/gpu/drm/i915/intel_i2c.c
> +++ b/drivers/gpu/drm/i915/intel_i2c.c
> @@ -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;

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Fixes: f899fc64cda8 ("drm/i915: use GMBUS to manage i2c links")
Cc: stable@vger.kernel.org
Jani Nikula Feb. 10, 2016, 8:56 a.m. UTC | #2
On Tue, 09 Feb 2016, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> On Tue, 09 Feb 2016, Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:
>> 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>
>> ---
>>  drivers/gpu/drm/i915/intel_i2c.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
>> index 25254b5c1ac5..deb8282c26d8 100644
>> --- a/drivers/gpu/drm/i915/intel_i2c.c
>> +++ b/drivers/gpu/drm/i915/intel_i2c.c
>> @@ -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;
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> Fixes: f899fc64cda8 ("drm/i915: use GMBUS to manage i2c links")
> Cc: stable@vger.kernel.org

And picked up to drm-intel-next-queued, thanks for the patch.

BR,
Jani.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index 25254b5c1ac5..deb8282c26d8 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -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;