Skip to contentSkip to conversation

floppy: fix lock imbalance

PATCH New Jiri Slaby 1 participant 1 message Jun 19, 2009

Subsystems (2)
lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 floppy: fix lock imbalance

A crappy macro prevents us unlocking on a fail path.

Expand the macro and unlock appropriatelly.

---
 drivers/block/floppy.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/block/floppy.c +4 -1
index 862b40c..91b7530 100644
@@ -3327,7 +3327,10 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
 		mutex_lock(&open_lock);
-		LOCK_FDC(drive, 1);
+		if (lock_fdc(drive, 1)) {
+			mutex_unlock(&open_lock);
+			return -EINTR;
+		}
 		floppy_type[type] = *g;
 		floppy_type[type].name = "user format";
 		for (cnt = type << 2; cnt < (type << 2) + 4; cnt++)
Signature · 1 line
1.6.3.2