aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r--drivers/block/loop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 3bba65510d23..e9d594fd12cb 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1038,10 +1038,10 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
1038{ 1038{
1039 int err; 1039 int err;
1040 struct loop_func_table *xfer; 1040 struct loop_func_table *xfer;
1041 uid_t uid = current_uid(); 1041 kuid_t uid = current_uid();
1042 1042
1043 if (lo->lo_encrypt_key_size && 1043 if (lo->lo_encrypt_key_size &&
1044 lo->lo_key_owner != uid && 1044 !uid_eq(lo->lo_key_owner, uid) &&
1045 !capable(CAP_SYS_ADMIN)) 1045 !capable(CAP_SYS_ADMIN))
1046 return -EPERM; 1046 return -EPERM;
1047 if (lo->lo_state != Lo_bound) 1047 if (lo->lo_state != Lo_bound)