diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2009-06-30 11:41:44 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-19 20:45:00 -0700 |
commit | 4af3aa317b819743c34e1f1b0bb989e132eaad46 (patch) | |
tree | 7d28229012f4c935fd4db0c234cdc92daa2788f0 /drivers | |
parent | a6dcca1cfed58986d9d0f5c0092855de946b4a91 (diff) |
floppy: fix lock imbalance
commit 8516a500029890a72622d245f8ed32c4e30969b7 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-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 615fcd33e83..5900f768e69 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -3320,7 +3320,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++) |