mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 11:16:11 +00:00
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>
This commit is contained in:
parent
9980060bad
commit
8516a50002
1 changed files with 4 additions and 1 deletions
|
@ -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++)
|
||||
|
|
Loading…
Reference in a new issue