diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2009-06-30 20:41:44 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-01 03:56:01 +0200 |
commit | 8516a500029890a72622d245f8ed32c4e30969b7 (patch) | |
tree | 8621a8d000d1397006a854c7d9de0d5d46842448 /drivers/block/floppy.c | |
parent | bfin: delay IRQ registration until driver is ready (diff) | |
download | linux-8516a500029890a72622d245f8ed32c4e30969b7.tar.xz linux-8516a500029890a72622d245f8ed32c4e30969b7.zip |
floppy: fix lock imbalance
A crappy macro prevents us unlocking on a fail path.
Expand the macro and unlock appropriatelly.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/block/floppy.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 862b40c90181..91b753013780 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -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++) |