mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
fs/ntfs3: Do not allow to change label if volume is read-only
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
parent
d27e202b9a
commit
e52dce610a
@ -497,7 +497,12 @@ static ssize_t ntfs3_label_write(struct file *file, const char __user *buffer,
|
||||
int err;
|
||||
struct super_block *sb = pde_data(file_inode(file));
|
||||
ssize_t ret = count;
|
||||
u8 *label = kmalloc(count, GFP_NOFS);
|
||||
u8 *label;
|
||||
|
||||
if (sb_rdonly(sb))
|
||||
return -EROFS;
|
||||
|
||||
label = kmalloc(count, GFP_NOFS);
|
||||
|
||||
if (!label)
|
||||
return -ENOMEM;
|
||||
|
Loading…
Reference in New Issue
Block a user