Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8516a500 authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds
Browse files

floppy: fix lock imbalance



A crappy macro prevents us unlocking on a fail path.

Expand the macro and unlock appropriatelly.

Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9980060b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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++)