Skip to contentSkip to conversation

i915: missing unlock on error path

PATCH In review Dan Carpenter 3 participants 3 messages May 7, 2010 – May 26, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i915: missing unlock on error path

There was a missing mutex_unlock(&dev->struct_mutex) on this error path.

---
I thought Jiri sent this patch earlier but a google search for "stanse struct_mutex i965_reset" didn't find any patches, so I'm resending.

drivers/gpu/drm/i915/i915_drv.c +1 -0
index 01e91ea..a605c87 100644
@@ -369,6 +369,7 @@ int i965_reset(struct drm_device *dev, u8 flags)
 		}
 	} else {
 		DRM_ERROR("Error occurred. Don't know how to reset this chip.\n");
+		mutex_unlock(&dev->struct_mutex);
 		return -ENODEV;
 	}
 

------------------------------------------------------------------------------

--

#1 lore raw
Quoted 6 lines · Dan Carpenter

There was a missing mutex_unlock(&dev->struct_mutex) on this error path.

---
I thought Jiri sent this patch earlier but a google search for "stanse struct_mutex i965_reset" didn't find any patches, so I'm resending.

I don't remember either. I found I had only fixed potential NULL-deref in i915_suspend.

Quoted 12 lines
drivers/gpu/drm/i915/i915_drv.c +1 -0
index 01e91ea..a605c87 100644
@@ -369,6 +369,7 @@ int i965_reset(struct drm_device *dev, u8 flags)
 		}
 	} else {
 		DRM_ERROR("Error occurred. Don't know how to reset this chip.\n");
+		mutex_unlock(&dev->struct_mutex);
 		return -ENODEV;
 	}
 
Signature · 5 lines
js

------------------------------------------------------------------------------

--
#2 lore raw
In reply to Dan Carpenter
Quoted 12 lines · Dan Carpenter

There was a missing mutex_unlock(&dev->struct_mutex) on this error path.

---
I thought Jiri sent this patch earlier but a google search for "stanse struct_mutex i965_reset" didn't find any patches, so I'm resending.

drivers/gpu/drm/i915/i915_drv.c +0 -0
index 01e91ea..a605c87 100644

drivers/gpu/drm/i915/i915_drv.c int i965_reset(struct drm_device *dev, u8 flags) · line 375

Quoted 7 lines
drivers/gpu/drm/i915/i915_drv.c +1 -0
@@ -369,6 +369,7 @@ int i965_reset(struct drm_device *dev, u8 flags)
 		}
 	} else {
 		DRM_ERROR("Error occurred. Don't know how to reset this chip.\n");
+		mutex_unlock(&dev->struct_mutex);
 		return -ENODEV;
 	}
 

Heh, got another version of this patch from Daniel J Blueman and ended up applying his first as I went through my tag:todo list. Thanks, though!

------------------------------------------------------------------------------

--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel