loop: mutex already unlocked in loop_clr_fd()

mount/1865 is trying to release lock (&lo->lo_ctl_mutex) at:
but there are no more locks to release!

mutex is already unlocked in loop_clr_fd(), we should not
try to unlock it in lo_release() again.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

authored by Alexander Beregalov and committed by Jens Axboe ffcd7dca b029195d

+5 -2
+5 -2
drivers/block/loop.c
··· 1431 static int lo_release(struct gendisk *disk, fmode_t mode) 1432 { 1433 struct loop_device *lo = disk->private_data; 1434 1435 mutex_lock(&lo->lo_ctl_mutex); 1436 ··· 1443 * In autoclear mode, stop the loop thread 1444 * and remove configuration after last close. 1445 */ 1446 - loop_clr_fd(lo, NULL); 1447 } else { 1448 /* 1449 * Otherwise keep thread (if running) and config, ··· 1456 1457 out: 1458 mutex_unlock(&lo->lo_ctl_mutex); 1459 - 1460 return 0; 1461 } 1462
··· 1431 static int lo_release(struct gendisk *disk, fmode_t mode) 1432 { 1433 struct loop_device *lo = disk->private_data; 1434 + int err; 1435 1436 mutex_lock(&lo->lo_ctl_mutex); 1437 ··· 1442 * In autoclear mode, stop the loop thread 1443 * and remove configuration after last close. 1444 */ 1445 + err = loop_clr_fd(lo, NULL); 1446 + if (!err) 1447 + goto out_unlocked; 1448 } else { 1449 /* 1450 * Otherwise keep thread (if running) and config, ··· 1453 1454 out: 1455 mutex_unlock(&lo->lo_ctl_mutex); 1456 + out_unlocked: 1457 return 0; 1458 } 1459